If you want to use built-in OS X commands, I’ve got a cURL FTP-upload handler that may be helpful.
Actually, you must have a utility (TinkTools, perhaps, in your System Prefs?) that forces all hidden files and folders to be displayed. The choose file dialog box hides them by default.
I’m afraid I don’t have tinkertool installed, and hidden files are not showing up anywhere else.
Also, I am relctuant to limit the file types because there are many types of files I wish to upload; html, asp, exe, flash swf, gif, jpeg, png, doc, xls, pdf etc. I have read I can only restrict the list to a maximum of four file types.
It seems that I was mistaken when I said there was a limit of 4 file types that could be defined. So I updated my original code to include as many filetypes I could think of that I might possiby need to upload.
if user_choice is "file" then
set theItem to (choose file with prompt "Choose a file from the Primary website to upload:" of type {" ", "TEXT", "JPEG", "PDF ", "GIFf", "SLD8", "W8BN", "XLS8", "ZIP ", "BINA"}) as string
The first type is four spaces because files which are downloaded via FTP often lose their Macintosh filetype and creator information. So now I have a very handy little util that uploads files on my Mac to the correct location on the Webserver, without having all those ugly and useless hidden files showing up in my dialog box.
Once again, many thanks for your help on this, everyone.
You may also want to add “???” which sometimes appears as a file type for files that lose their file types in transit. I’ve also used this file type: ((ASCII character 0) & (ASCII character 0) & (ASCII character 0) & (ASCII character 0)) for “.plist” files and others. You usually can’t copy and paste this one but using the “ASCII character” call works.
Apple really needs to update choose file to have an additional optional parameter list of “file extension” since they’ve turned their back on the resource fork.