>Thanks to Andu and Scott Raney for the ftp MetaCard stack!  Using the ftp
>stack as an example, I've built a stack that can upload and download files
>to a password-protected server via ftp, and all the user has to do is click
>one button.  Love it, LOVE IT!
>
>And now of course I have another question! When uploading a file, I did not
>want to read it all into memory first... rather, I wanted to read a bit,
>send a bit, read a bit, send a bit, etc.  This would cut down dramatically
>on RAM usage for folks sending huge files.  To make a real long story short,
>I got it working.  But in order for it to work, I had to get the file size
>of the file I was sending.  My current way of doing this is inelegant...
>
> put 0 into tBytes
>  repeat while the result is not "eof"
>    read from file sourceName for 20000 characters
>    put the number of characters in it + tBytes into tBytes
>  end repeat
>  close file sourceName
>
>Can anyone suggest the best way to do this in the Mac and also Windows?  If
>so, thanks in advance!
Best way it may not be but different, yes:

 put "file:" & fileX into tFile # fileX is the path to your file
  put the length of  url  tFile  into tBytes
    put 1 into tOffset
  open file fileX  for read
    repeat
    if tOffset >= tBytes then exit repeat
    read from file fileX  at tOffset for 2000
    put it after Var1 # or whatever
    add 2000 to tOffset
  end repeat
  close file fileX
>
>
>:)
>Richard MacLemale
>
>
>Archives: http://www.mail-archive.com/metacard%40lists.best.com/
>Info: http://www.xworlds.com/metacard/mailinglist.htm
>Please send bug reports to <[EMAIL PROTECTED]>, not this list.
>
> 

Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to