FTP Application vs Revlet
Posted: Wed Nov 10, 2010 9:45 am
I am trying to ftp files to on-rev after constructing them in revolution.
The code works fine in the IDE and in a compiled app.
However, when I create a web version it creates the file (took me a while to figure out where it was being created) but won't upload it.
put "ftp://user:password" & \
"@" & "domain.on-rev.com" & "/" into urlpath
put fld "Event_ID" & "_" & fld "thisbout" & ".htm" after urlpath
put the defaultfolder into xxx
put xxx & "/" & fld "Event_ID" & "_" & fld "thisbout" & ".htm" into htmlstuffiOutFileName
put htmlstuffiOutFileName into fld myStatus
open file htmlstuffiOutFileName for write
write htmlstuff to file htmlstuffiOutFileName
close file htmlstuffiOutFileName
uploadResults htmlstuffiOutFileName,urlpath
...
on uploadResults mySourceFile,myTargetFile
set the cursor to watch
put false into myResult
put doFTPcontent(mySourceFile, myTargetFile) into myResult
end uploadResults
function doFTPcontent myContent, myFilenameAndPath
put myFilenameAndPath into urlpath
set the itemdelimiter to tab
libURLSetStatusCallback "myProgress",the long id of fld "myStatus"
libURLftpUploadFile myContent,urlpath
put the result into myFTPResult
return myFTPResult
end doFTPcontent
The code works fine in the IDE and in a compiled app.
However, when I create a web version it creates the file (took me a while to figure out where it was being created) but won't upload it.
put "ftp://user:password" & \
"@" & "domain.on-rev.com" & "/" into urlpath
put fld "Event_ID" & "_" & fld "thisbout" & ".htm" after urlpath
put the defaultfolder into xxx
put xxx & "/" & fld "Event_ID" & "_" & fld "thisbout" & ".htm" into htmlstuffiOutFileName
put htmlstuffiOutFileName into fld myStatus
open file htmlstuffiOutFileName for write
write htmlstuff to file htmlstuffiOutFileName
close file htmlstuffiOutFileName
uploadResults htmlstuffiOutFileName,urlpath
...
on uploadResults mySourceFile,myTargetFile
set the cursor to watch
put false into myResult
put doFTPcontent(mySourceFile, myTargetFile) into myResult
end uploadResults
function doFTPcontent myContent, myFilenameAndPath
put myFilenameAndPath into urlpath
set the itemdelimiter to tab
libURLSetStatusCallback "myProgress",the long id of fld "myStatus"
libURLftpUploadFile myContent,urlpath
put the result into myFTPResult
return myFTPResult
end doFTPcontent