tsneterr error sending images from mobile device to server

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

tsneterr error sending images from mobile device to server

Post by cusingerBUSCw5N » Tue Nov 29, 2016 3:39 am

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!

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: tsneterr error sending images from mobile device to serv

Post by cusingerBUSCw5N » Tue Nov 29, 2016 3:48 am

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

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: tsneterr error sending images from mobile device to serv

Post by jiml » Tue Nov 29, 2016 8:28 pm

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

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: tsneterr error sending images from mobile device to serv

Post by cusingerBUSCw5N » Wed Nov 30, 2016 7:12 pm

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.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: tsneterr error sending images from mobile device to serv

Post by cusingerBUSCw5N » Wed Nov 30, 2016 7:17 pm

Confirmed this is a bug 18383

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: tsneterr error sending images from mobile device to serv

Post by LiveCode_Panos » Thu Dec 01, 2016 3:40 pm

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
--

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: tsneterr error sending images from mobile device to serv

Post by cusingerBUSCw5N » Wed Dec 07, 2016 5:38 pm

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.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”