Hi there,
Not quit as straight forward as i thought "my workaround"
On a button i have this hacky way of uploading a folder to the server. As you cant upload a file to a folder that does not already exist in one operation with ios.
this hack will not return anything but error in the urlProgress even though it does indeed create a folder.
Code: Select all
put"ftp://"&gUsername&":"& URLEncode(gPassword) & "@"&gServer&"/"&gPath&"/Airweaver/" into tURL
put "rubish" into URL tURL -- this works on it's own and does create a folder "Airweaver"
end touchEnd
on urlProgress pURL, pStatus
if pStatus is "error" then
testfileupload --goes to the handler on the card
end if
end urlProgress
So i figured i could then quickly upload a test file to the newly created folder, to acctually get a true return from urlProgress
The next handler on the card to upload a test file to the newly created folder and test if the test file has been uploaded:
Code: Select all
on testfileupload
put"ftp://"&gUsername&"t:"& URLEncode(gPassword) & "@"&gServer&"/"&gPath&"/Airweaver/auth.txt" into tURL
put "authenticated" into URL tURL
end testfileupload
on urlProgress pURL, pStatus
if pStatus is "uploaded" then
put "uploaded" & cr into field "result"
end if
if pStatus is "error" then
put "error" & cr into field "result"
end if
end urlProgress
This still returns an error every time, when the operation is chained like this.
I was under the impression that urlProgress would be returned to the object that it is called from.
It looks to me like i am calling it from the card in the second handler after the Airweaver folder has been created, so there should not be a problem with that second ftp upload..?
[EDIT] i did check the server after each of my tests, and the folder does get created but the test file does not, when chained like this.
Can anyone see the error of my ways here..?