Cannot get image to upload to FTP on iOS
Posted: Thu Nov 26, 2015 12:29 pm
After struggling for countless hours with this, having read all the documentation/forum posts online about similar topics and issues, I'm coming here in the hope of getting an answer.
Platform is iOS. I've created a new stack to reduce unknowns, with the single button which is meant to do the following:
1) Capture image using rear camera - works
2) Export this image to file - works
3) Set up FTP details - taken out specifics in this example
4) Rename the image - works
5) Upload the new file - does not work
The answer of the result is: "The operation couldn't be completed. (kCFErrorDomainCFNetwork error 2.)
Any idea? I've used the exact same script on the desktop version of Livecode and it renames and uploads the file correctly to the FTP.
Platform is iOS. I've created a new stack to reduce unknowns, with the single button which is meant to do the following:
1) Capture image using rear camera - works
2) Export this image to file - works
Code: Select all
put specialFolderPath("documents") & "/new_large.png" into tFile1
export the last img to file tFile1 as PNG
Code: Select all
put "x" into sUsername
put "x" into sPassword
put "0.0.0.0/x/x" into sHost
put "78" & "_large" into sName
put urlEncode(sUsername) into sUsername
put urlEncode(sPassword) into sPassword
put urlEncode(sHost) into sHost
put urlEncode(sName) into sName
Code: Select all
put specialFolderPath("documents") & "/new_large.png" into tFile1
put specialFolderPath("documents") & "/"&sName&".png" into tFile2
if there is a file tFile1 then
rename tFile1 to tFile2
Code: Select all
put "ftp://"&sUsername&":"&sPassword&"@"&sHost & slash &sName &".png" into urlName
put url ("binfile:" & tFile2) into tExport
put tExport into url (urlName)
if the result is not empty then
answer "URL put failed: " & the result
else
answer "Success!"
end if
Any idea? I've used the exact same script on the desktop version of Livecode and it renames and uploads the file correctly to the FTP.