Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / GetHTTPFile() I can find the file but I can't get to it.

Author
Message
JRNTexas
12
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 6th Aug 2020 15:10
I'm using GetHTTPFile to retrieve a .png image. In Windows (I haven't tried it on another platform) it is storing the file under the AppData directory, not the local media directory.

After retrieving the file, when I try to load the file, it looks in the local media directory not the media directory located und the AppData directory. How do I either save it to the correct directory or find it with a LoadImage call?

//where the image is actually at:
C:\Users\jesse\AppData\Local\AGKApps\SmartMirror\media

//where LoadImage is looking:
C:\Users\jesse\AGK\Projects\SmartMirror\media

SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 6th Aug 2020 18:04
In your GetHTTPFile command, you can preface the destination filename with the target you want to use. So with:

GetHTTPFile( iHTTP, szServerFile, szLocalFile, szPostData )

Where 'szLocalFile' is, include your target destination with the 'raw:' tag, such as:

raw:C:\Users\jesse\AGK\Projects\SmartMirror\media\MyImage.png

That will place the downloaded file in the location you specify. LoadImage will also fallback to the AppData folder as secondary, as long as you don't have another file by the same name in the primary app \media folder.
JRNTexas
12
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 6th Aug 2020 18:49
@SFSW ~ Thanks! I will try this later today.

Login to post a reply

Server time is: 2024-04-19 04:43:52
Your offset time is: 2024-04-19 04:43:52