FTP upload anomaly--file opened, but nothing written

Sivakatirswami katir at hindu.org
Wed Jan 23 17:58:08 CST 2002


I have a  script that uploads a file and then uploads a copy of the same
file to a different directory. In 2.3.2  I wrote the socket myself (well,
actually hacked from Andu's FTP client and dedicated to single site/file
task) and used it completely, twice. This worked fine... one file is
uploaded... feedback is channeled to a log field the user can watch...when
the upload was complete, turn around, open a new socket and upload the
archive file. 

So, trying to do the same with the new URL command set I get this anomaly
from the following script... first file is written, second file is opened,
but no data is written to it.

I know the second handler is correct, because if I run it separately by
itself... from the message box...the file uploads and data is written
properly... but in a "one two" sequence...  no data is written in the second
handler??

The behaviour is exactly the same in Metacard and Revolution (where, in the
latter case, the "start using stack libURL" is not needed).

Well, of course the immediate solution to the problem is to for me to simply
use my own full socket scripts (which are a lot faster anyway than libURL.)

But it would be good to have a solution for this, as, obviously, it is much
easier to script a single FTP command line than write the entire socket, as
I am looking for a general purpose solution where I only have to pass the
user:pass:host:path to single command line in scripts.

Also, there is zero feedback mechanism in the current libURL for an FTP
upload... but of course that is being looked into already no doubt.

==========
on upload
  start using stack "libURL"
  put "ftp://"&gUser&":"&gPass&"@"& gHost&gPath&gFilename into gMachinePath
  put fld "ftext" into URL gMachinePath
## the above works fine
  if (gUser is "gurudeva") and (gFileName is "index.shtml" ) then
uploadToArchives
end upload

on uploadToArchives
  start using stack "libURL"
  put line 3 of fld "fText" into tDate
  put  word 6 of tDate  into tDay
  delete last char of tDay
  if tDay is among the items of (1,2,3,4,5,6,7,8,9) then put "0" before tDay
  put word 5 of tDate  &"_"& tDay&"_" &word 7 of tDate into tDateString
  put "archives/"&tDateString&"/index.shtml"  into archiveFile
  put "ftp://"&gUser&":"&gPass&"@"& gHost&gPath&archiveFile into
gMachinePath
  put gMachinePath
##the above works fine if you run "uploadToArchives" from the message box
## but not in sequence from the "upload" handler above.

TIA!

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
katir at hindu.org 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org

Read The Master Course Lesson of the Day at
http://www.gurudeva.org/lesson.shtml




More information about the use-livecode mailing list