Re: upload via ftp
Re: upload via ftp
- Subject: Re: upload via ftp
- From: Jolly Roger <email@hidden>
- Date: Thu, 26 Apr 2001 07:50:15 -0500
- Replyto: email@hidden
on 4/26/01 6:28 AM, jake williamson 28 (email@hidden) wrote:
>
what i need is a folder action that reacts when ever a file is saved into a
>
specific folder ie my php development folder. i need it to take that file
>
and upload it via ftp into a designated file on the webserver. this means
>
that every time i want to test something, i just hit save in bbedit and
>
switch to my browser and hit refresh. wicked!
I use this (uses Anarchy/Interarchy):
on UploadFile(myFile, myFTPHost, myFTPPath, myUsername, myPassword)
tell application "Interarchy"
activate
delay 3 -- gives Interarchy time to come up on slow machines
with timeout of 604800 seconds -- timeout in one week =)
set err to store file myFile host myFTPHost path myFTPPath user
myUsername password myPassword
end timeout
if err is not 0 then
if err is -37 then display dialog "One of the items you are
uploading contains an illegal character. Only alphanumeric characters are
allowed."
display dialog "Error: " & err
end if
-- quit
end tell
end UploadFile
(Watch for line wraps...)
HTH
JR