|
POST
|
As much as regex is still black magic to me, it does seem like the best solution here.
... View more
03-17-2021
07:32 AM
|
0
|
0
|
3772
|
|
POST
|
Here's a solution from @ReneRubalcava Solved: Re: When featurelayer done drawing - Esri Community
... View more
03-15-2021
07:32 AM
|
1
|
0
|
2686
|
|
POST
|
Sorry if I convolute this situation more for you @Mick , but I just want to add that you can use a wildcard argument with ListFiles() to only return txt files. import arcpy
import os
inPut = r'D:\Downloads\aatester'
arcpy.env.workspace = inPut
myList = arcpy.ListFiles("*.txt")
for fileName in myList:
out = os.path.join(inPut, f"{fileName[:-4]}.txt")
print(out)
with open(out, "a") as k:
k.write('Hellow') Additionally, I updated your path construction to use os.path.join() so it reliably does the separator. You will also notice the f string formatting for the file name. This will function the same but I just wanted to demonstrate there are multiple ways to accomplish something.
... View more
03-12-2021
06:54 AM
|
1
|
0
|
1190
|
|
POST
|
You could disable directory browsing but the service is still available if you use browser developer tools to monitor network traffic. If your organization has a load balancer managing traffic coming in, maybe you could set up a url referrer allow list for your services so it blocks anything coming in that's not from your app. I'm not a network engineer so I can't be of anymore help there. I don't think there's anything natively available in ArcGIS Server to do this.
... View more
03-10-2021
12:31 PM
|
0
|
0
|
3242
|
|
POST
|
An address from a form is just a string. You will need to geocode it to determine the actual spatial location (geometry) in order to perform geometry operations with it, like testing if it's located inside a polygon.
... View more
03-10-2021
11:11 AM
|
0
|
0
|
2830
|
|
POST
|
You would need to geocode the address (unless you have an address layer you can search) to get a location; probably with the Search widget. Then use the geometry engine contains() method to test the address location with your polygon.
... View more
03-10-2021
10:26 AM
|
0
|
2
|
2836
|
|
POST
|
The error is pretty clear: Can't change directory to /srv/ftp/pub/crimemaps: No such file or directory Can you verify that path is correct and the folders exist in the ftp site?
... View more
03-09-2021
07:02 AM
|
1
|
0
|
8225
|
|
POST
|
Change the working directory before you call the STOR command to copy the file. session.cwd('/srv/ftp/pub/crimemaps')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filename, file_object)
print('Sent file')
... View more
03-09-2021
06:50 AM
|
0
|
2
|
5273
|
|
POST
|
Don't pass anything as an argument. Just do file_object.close() However, a better way would be to use the with keyword to open and automatically close the file. Otherwise, you should be using a try/except/finally with open/close. # define ftp session out here
try:
# Choosing file to send
filename = 'TEST12142020.pdf'
filepath = r'C:\temp\{}'.format(filename)
with open(filepath, 'rb') as file:
print ('Opened file')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filename, file)
print('Sent file')
finally:
session.quit()
... View more
03-04-2021
01:00 PM
|
1
|
5
|
5343
|
|
POST
|
According to this, try just using the file name in the command. # Choosing file to send
filename = 'TEST12142020.pdf'
filepath = r'C:\temp\{}'.format(filename)
file_object = open(filepath, 'rb')
print ('Opened file')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filename, file_object)
print('Sent file')
... View more
03-04-2021
11:48 AM
|
1
|
8
|
12314
|
|
POST
|
Try putting the file in a simpler directory, like C:\temp\TEST12142020.pdf
... View more
03-04-2021
11:12 AM
|
0
|
10
|
5359
|
|
POST
|
The command input needs to be a path to the file, not a folder. Try filepath = r'G:\GIS\filepath\TEST12142020.pdf'
file_object = open(filepath, 'rb')
print ('Opened file')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filepath, file_object)
print('Sent file')
... View more
03-04-2021
11:06 AM
|
0
|
12
|
6969
|
|
POST
|
You formatted the file path a a raw string but then included the escape backslash. You have to do one or the other. I recommend just using the raw string with single backslashes. filepath = r'G:\GIS\filepath'
file_object = open(r'G:\GIS\\filepath\TEST12142020.pdf', 'rb')
print ('Opened file')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filepath, file_object)
print('Sent file')
... View more
03-04-2021
10:57 AM
|
0
|
14
|
6972
|
|
POST
|
As the error says, you cannot concatenate 'str' and 'file' objects. You'd have to do something like filepath = r'G:\\GIS\\filepath'
file_object = open(r'G:\\GIS\\filepath\\TEST12142020.pdf', 'rb')
print ('Opened file')
# Sending the file
print('Sending file')
session.storbinary('STOR ' + filepath, file_object)
print('Sent file')
... View more
03-04-2021
10:28 AM
|
0
|
16
|
6976
|
|
POST
|
It looks like the highlightOptions are set on the SceneView so changing it will affect all features highlighted. I think what you might have to do is add the features to a GraphicsLayer, each with a different symbol.
... View more
03-04-2021
06:43 AM
|
2
|
1
|
5067
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |