Page 1 of 1

tsneterr error sending images from mobile device to server

Posted: Tue Nov 29, 2016 3:39 am
by cusingerBUSCw5N
I am trying to send images from a cellphone to my server.

I am using mobilepickphoto "library" and am getting this error on an iPhone (have not tested it on an android):
Upload failed: tsneterr: (9) Server denied you to change to the given directory

Code: Select all

      set the name of the templateImage to "imageUpload"
      if the environment is "mobile" then
         mobilepickphoto "library"
        answer "imageSelected"
      else
         set the cursor to watch
         answer file "Please select an image file"        
         put url ("binfile:" & it) into image "myimage"       
      end if
      
      if the result is empty then
         put the text of image "imageUpload" into tImagetoUpload
         answer "imageDataGathered"

   
            put tImagetoUpload into url("ftp://ftpaddress and filename.png")
            if the result is not empty then
               answer "Upload failed:" && the result
end if

Code: Select all

    

So...either my code is wrong...or there is a bug.  Can you tell me if the code for sending an image to my server is correct?   Thanks!

Re: tsneterr error sending images from mobile device to serv

Posted: Tue Nov 29, 2016 3:48 am
by cusingerBUSCw5N
I found this as a possible explanation: https://technicalsanctuary.wordpress.co ... directory/
and am going to try the solution - which is to put an extra / after the ip address. Will report on whether it works

Re: tsneterr error sending images from mobile device to serv

Posted: Tue Nov 29, 2016 8:28 pm
by jiml
Perhaps this:

Code: Select all

url("ftp://ftpaddress and filename.png")
should be:

Code: Select all

url("ftp://ftpaddress/filename.png")
Of course the server file's name is actually "filename.png" and that will be replaced every time this handler is called.

If you want a file for EVERY time a picture is uploaded then you could add a differentiating string to each file name, such as milliseconds:

Code: Select all

url("ftp://ftpaddress/filename" & the milliseconds & ".png")
Or if you want to save it under the same name as on the user's device then extract the user's file name from mobilepickphoto or 'answer file' and put it into a variable, say myFileName.

Code: Select all

 url("ftp://ftpaddress/" & myFileName)
JimL

Re: tsneterr error sending images from mobile device to serv

Posted: Wed Nov 30, 2016 7:12 pm
by cusingerBUSCw5N
So...just for the record... the solutions above didn't work....

I created a small stack with just two buttons - one to send an existing image to my server. The other to take a picture and send it to the server.

The code for Existing Image:

Code: Select all

on mouseUp
   
   
   set the name of the templateImage to "imageUpload"
   if the environment is "mobile" then
      mobilepickphoto "library"
      answer "imageSelected"
      
   end if
   
   if the result is empty then
      
      put the text of image "imageUpload" into tImagetoUpload
      
      answer "imageDataGathered"
      put "test" into tfinal
      
     put "xxxx" into tFTPUser
      put "xxxx" into tFTPPassword
      put "ftp.website/path" into tFTPServer
      
      put "test1" into tfinal
      answer "This worked in August"
      put tImagetoUpload into url("ftp://" & tFTPUser & ":" & tFTPPassword & "@" & tFTPServer & "/" & tfinal & ".png")
      put the result into twhy
      answer twhy
      
      put "test2" into tfinal
      answer "This is with  a slash at the end of tFTPServer"
      put "ftp.toolsforbusiness.info//ToolsforBusiness/disaster1/disaster_images_biz/" into tFTPServer
      put tImagetoUpload into url("ftp://" & tFTPUser & ":" & tFTPPassword & "@" & tFTPServer & "/" & tfinal & ".png")
      put the result into twhy
      answer twhy
      
      answer "done"
      
      delete image "imageUpload"
      
   end if
end mouseupend mouseup
ANDROID (using livecode 9.0): So in both cases, I got tsneterr (6) Cold not resolve host. ..... even though the first version worked in August. For taking a picture, I got the same error.

IOS (using livecode 8.1): For taking a picture, I found that my iPhone has a black screen for MobilePickPhoto camera. The existing picture gave me an error: tsneterr: (9) Server denied you to change to the given directory

I vote that this is a bug in the upgraded LiveCode.

Re: tsneterr error sending images from mobile device to serv

Posted: Wed Nov 30, 2016 7:17 pm
by cusingerBUSCw5N
Confirmed this is a bug 18383

Re: tsneterr error sending images from mobile device to serv

Posted: Thu Dec 01, 2016 3:40 pm
by LiveCode_Panos
Hi Carolyn,

I think what you see is different from what bug 18383 is about. Please see comment 8 in this report http://quality.livecode.com/show_bug.cgi?id=18383.

Best,
Panos
--

Re: tsneterr error sending images from mobile device to serv

Posted: Wed Dec 07, 2016 5:38 pm
by cusingerBUSCw5N
The problem still exists. It says "success" - but the file isn't sent - or it arrives with 0 file size. When you do a answer the result, it shows an tserr error. Tested on multiple servers.