Page 1 of 1

File Wont Save To Android

Posted: Wed Jun 03, 2020 12:24 pm
by Googie85
Hi Guys!!

I have an Android app that receives a file from the Client. I have no problems saving the received image into Windows folders but I cannot save to an Android device. I have edited the Stand Alone App Settings and enabled Write External Storage in the Android Tab Menu. I have tried specialfolderpath("resources") and specialfolderpath("documents") with no luck. Am I doing something wrong in my code? I can post my Client code but I believe it to be the Server that is giving me issues.

Many Thanks,

Googie.

Code: Select all

on mouseUp   
if the field "text" = "Disconnected" then
      accept connections on port 12345 with message "clientConnected"
      put "Connected" into field "text"
   else
      close socket "12345"
      put "Disconnected" into field "text"
      
   end if
end mouseUp

on clientConnected tSocket   
   answer "Connected"
   read from socket tSocket until "§" with message "messageReceived"
end clientConnected

on messageReceived tSocket, pMsg
   if char -5 to -1 of pmsg is "file§" then
      delete  char -5 to -1 of pmsg
      put arraydecode(base64decode(pmsg)) into temp
      put temp["name"] into tName
      
            //put "C:\users\h5n1s\desktop\image.jpeg" into filerun
            
      put "binfile:/" & tName into filerun
      put temp["data"] into URL filerun
      

      
      answer filerun
      
      set the filename of image "image1" to filerun
            
   end if
   read from socket tSocket until "§" with message "messageReceived"   
end messageReceived

Re: File Wont Save To Android

Posted: Wed Jun 03, 2020 12:40 pm
by Klaus
Hi Googie,

in specialfolderpath("documents") we DEFINITIVELY have write permission!
What did you script so far? And what is in -> tName?


Best

Klaus