URL Access Scripting: Extension Failure

I am trying to use this code to upload a single file to an ftp server and keep getting the same error.

URL Access Scripting: Extension Failure


set uploadFile to "/MiScreen/MiScreenShot.jpg"
set uploadFile to POSIX file uploadFile

set fullUrl to "ftp://user:pass@my.server.com"

tell application "URL Access Scripting"
	upload uploadFile to fullUrl replacing yes without binhexing
end tell




I have looked everywhere to no avail. This code matches just about everything that I have found, and I still get the same error. Any help would be appreciated.

Thanks

I racked my brain over this issue as well on OSx 10.4. It does work on 10.3.9. I ended up using curl to get the job done. With curl I use the do shell script command… and example of this is:


set myuploadfile to "/user/kdurrum/test1.txt"

set mycommand to "curl ftp://myserveraddress//mydir1/mydir2/ -u myuser:mypassword -T " & myuploadfile as string

do shell script mycommand

This should do the trick for you.

Is it then a Tiger issue?

I know that this script worked in Panther. I have not been developing for a while (Tiger broke my program–it has been recently ressurected however, and is well on its way back from the dead) and I was racking my brain as I knew that it once used to work.

Do you think that this issue us worth informing Apple over?

It seems that if a fairly basic (and somewhat vital) function of AS is not working under Tiger that they ought to be informed (if they are not already).

I tried curl per your suggestion, and either I have mistyped something, or there is something not happy with my server and automated ftp uploads. I can’t imagine that that is the case though.

Can you send me the curl argument again (something looks funny) so that I can try yet again.

Thanks man!! :slight_smile:

URL Access Scripting Revelation in Tiger!!!

For one reason or another, Tiger requires that one closes the target directory in the ftp server in order to have the file carry over. It seems that URL Access Scripting may now be connected to curl (as Image Events is to sips) as I discovered the problem and solution in the curl man pages.

I tried the solution in the terminal, and it worked. I tried the exact same solution in Applescript and it worked the very first time.


set uploadFile to "/MiScreen/dataFiles/defaultEmail"

--set userName to text returned of (display dialog "Username:" default answer "Username")

set ftpServer to text returned of (display dialog "What is your ftp server?" default answer "ftp://")

tell application "URL Access Scripting"
	upload uploadFile to "ftp://@" & ftpServer with authentication without binhexing
end tell


When I entered my.server.info I received the Extension Error. I also received an error when trying to use curl.

But when I entered my.server.info/ (in both curl and Applescript) the process worked just as it should.

I wonder why Tiger requires this (or why my server requires it) closing slash when nothing else does.

Weird.