File Wont Save To Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 147
Joined: Tue Aug 05, 2014 10:07 am

File Wont Save To Android

Post by Googie85 » Wed Jun 03, 2020 12:24 pm

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

Klaus
Posts: 12195
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: File Wont Save To Android

Post by Klaus » Wed Jun 03, 2020 12:40 pm

Hi Googie,

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


Best

Klaus

Post Reply

Return to “Android Deployment”