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 Classic Chat / Can I upload jpg to a server?

Author
Message
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 5th Mar 2019 09:28
just that, I have tried with the examples that I have found and I have not succeeded. I have a program almost finished and I need to upload jpg to finish it.
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 5th Mar 2019 10:11 Edited at: 5th Mar 2019 10:18
is an online photo developing kiosk, which I have been developing for several months, now the whole part of android is finished, some touch-ups would be missing.
I was sure I could upload jpg to my server, but now I'm not so sure, I'm starting to think that I've just wasted my time trying to do this in AGK.

Attachments

Login to view attachments
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 5th Mar 2019 10:35
You can upload to the server. I can share some code later on tonight if needed. At work at the moment. I have images uploading in my AppGameKit app
OryUI - A WIP AGK2 UI Framework
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 5th Mar 2019 10:57
I would appreciate it very much, I keep trying but I can not. I do not know if it's the fault of AppGameKit, of my serdidor or I'm just doing something wrong.
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 5th Mar 2019 12:40 Edited at: 5th Mar 2019 12:41
Before then, check out this page as I believe I used the example on the help page as a starting point

https://www.appgamekit.com/documentation/Reference/HTTP/SendHTTPFile.htm

The example PHP code needs improving so that you reduce the risk of people uploading malicious files. I'm no expert on securing such uploads but using this and some examples found via Google I modified it to hopefully stop non images being uploaded. I can share the final PHP code later. I did look at a couple of opensource PHP image uploader scripts that were written by people that know what they're doing but I couldn't get any of them working with AppGameKit and my server set up. I ended up modifying the above example.
OryUI - A WIP AGK2 UI Framework
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 5th Mar 2019 13:17 Edited at: 5th Mar 2019 13:18
While I remember... There seems to be a bug with the URL parameters part of the SendHTTPFile function, so if you're passing through a string of parameters i.e. "&username=KevinCross&token=123456789&platform=Android" the first field username can't include the & sign. So it'll look like this: "username=KevinCross&token=123456789&platform=Android". This stumped me for a while. It's accepted with SendHTTPRequestASync which is why the problem wasn't obvious.
OryUI - A WIP AGK2 UI Framework
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 5th Mar 2019 16:59 Edited at: 5th Mar 2019 17:01
I think the problem is that I do not understand how the http works, how to include it so that it works. Therefore, the problem would not be completely AppGameKit, that if a little more information would be fine.
I'm trying to learn how to include or modify or what to do with the php
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 5th Mar 2019 18:26
In the end I got it, Thank you very much for your help Kevin Cross, I had to do a little research on PHP which was what I did not understand. Thanks to your verification to tell me that it worked gave me courage to continue trying. Thank you
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Mar 2019 20:29 Edited at: 5th Mar 2019 20:31
Glad you got it sorted Furord
for future reference https://www.w3schools.com/ is a great lookup spot to
to look up commands for anything web-based. The site is free and does not require
any registration. A very good place to learn any of the web languages or formats as
it has the ability to teach and test you the commands. I have used the site many times
and continue to go back when I forget syntax etc
fubar
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 9th Mar 2019 00:37
I didn’t know this feature exist. Now, this got me thinking of creating avatars for users cross platforms for both iOS and Android.
Furord
10
Years of Service
User Offline
Joined: 8th Aug 2014
Location:
Posted: 14th Mar 2019 00:23 Edited at: 14th Mar 2019 00:26
luck friend, I got it but I had to use a small program made with DBP as a support since in AppGameKit there is no possibility to use ftp and it is essential for what I want, I hope they add that function soon. regards

Login to post a reply

Server time is: 2024-11-18 21:18:00
Your offset time is: 2024-11-18 21:18:00