Hi,
I am trying to upload a video to a ftp-server. Uploading an image is no problem. With the code below I also can upload a file, but not the video. The content of the file is only the path, if I open the file with an editor.
For pick the video I have an external av from mergext
the problem is the line: put tFileForUpload into URL theURL - only the filepath is in the uploaded file
here I need binary files ? but how to "convert"?
thanks for help
Chris
Code: ***********************************************
on touchEnd pId
mobGUIUntouch the long id of me
local tFileForUpload, tFileName
put mergAVPick("library","medium",180) into tFileForUpload
set the itemdel to "/"
put "ftp://user:pwd@ftpserver/myvideo1.mov" into theURL
put tFileForUpload into URL theURL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if the result is not empty then
answer the result
hide group "progress"
end if
end touchEnd
Upload Video per FTP
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Upload Video per FTP
Hi,
I found a first solution:
I replace: put tFileForUpload into URL theURL
to:
put tFileForUpload into theFilePath
open file theFilepath for binary read
read from file theFilePath until end
put it into theBinaryData
close file theFilePath
put theBinaryData into URL theURL
the other question: is this solution good for large files 30-70 MB?
thanks
Chris
I found a first solution:
I replace: put tFileForUpload into URL theURL
to:
put tFileForUpload into theFilePath
open file theFilepath for binary read
read from file theFilePath until end
put it into theBinaryData
close file theFilePath
put theBinaryData into URL theURL
the other question: is this solution good for large files 30-70 MB?
thanks
Chris
Re: Upload Video per FTP
You would be better off doing a loop over the data and upload it in chunks so as not to tie up your GUI (remember Rev is single threaded).. By doing the "read until EOF" you are loading the whole file in to memory first and then sending it.. When doing your loop, do not use a repeat structure, but a recursive send loop..
Re: Upload Video per FTP
thanks for your answer and suggestion.
Do you have a short code example or link to one of a "recursive send loop"?

Do you have a short code example or link to one of a "recursive send loop"?