Hello all, For a current project I created a script tool that exports attributes of selected point features to a comma-separated .txt file. The tool then removes certain columns from the .txt file, saves it to a new location, and sends it via FTP.The next thing I need to do is publish this as a GP service in ArcGIS Server 10. The part that I am having trouble with is the selection of points by the user - in Desktop the script will export any features that are selected, but I'm unsure how to make the same thing work on the web (this will be in a Flex application).So, how should I set up the service to pass the selection to the service? I have included the full script below in case it helps with answers.Thanks, Tim.
import arcpy, csv, ftplib, os
Input_Feature_Class = " "
Value_Field = " "
Delimiter = " "
OutputDirectory = " "
FTPDirectory = " "
Output_ASCII_File_Name = arcpy.GetParameterAsText(0)
Output_ASCII_File = OutputDirectory + Output_ASCII_File_Name + ".txt"
Add_Field_Names_to_Output = "ADD_FIELD_NAMES"
# Run ExportXYv_stats to export .txt file of records
arcpy.ExportXYv_stats (Input_Feature_Class, Value_Field, Delimiter, Output_ASCII_File, Add_Field_Names_to_Output)
#REMOVE UNNEEDED COLUMNS AND CREATE NEW FILE IN FTP/LOG FOLDER
input = Output_ASCII_File
outputFile = FTPDirectory + Output_ASCII_File_Name + ".txt"
output = open(outputFile, 'w')
readFile = csv.reader(open(input, 'r'))
for row in readFile:
print >>output, row[2]
output.close()
#FTP FILE TO SERVER
inputFTP = outputFile
fileName = Output_ASCII_File_Name + ".txt"
server = " "
username = " "
password = " "
sftp = ftplib.FTP(server, username, password)
fp = open(inputFTP, 'rt')
sftp.storbinary('STOR '+ fileName, fp)
fp.close()
sftp.quit()