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

Author
Message
Jaxon Weis
10
Years of Service
User Offline
Joined: 17th Jul 2013
Location:
Posted: 19th Jul 2013 19:50
Im just trying to send a png file to a server with php

php code


using this AppGameKit code Tier 1 with v1076 with matching player



and I get this http://i.imgur.com/P7aadu1.png

but if I use a html form like this


I get this result

http://i.imgur.com/di28f1fh.png

Anyone have any ideas on 1 why AppGameKit file upload is showing as a compressed file and 2 why it is failing all together?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Jul 2013 21:09 Edited at: 19th Jul 2013 21:34
Will you please show the code you used that used the html form on the server?

I want to be sure of the exact situation before I comment.

EDIT: Are there any error messages in the error.log file on the server? For instance, something like -


EDIT2: When I tested your php file and code on my computer, and substituted 'myfile' for 'userfile', it worked flawlessly.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Jaxon Weis
10
Years of Service
User Offline
Joined: 17th Jul 2013
Location:
Posted: 19th Jul 2013 21:15
The html form was sent to the php code that is in my post.

Is that what you are asking for?
Jaxon Weis
10
Years of Service
User Offline
Joined: 17th Jul 2013
Location:
Posted: 19th Jul 2013 21:51
Your right it works beautifully when I substituted 'myfile' for 'userfile'

I'm not quite sure why there is no problem in html but it is working

Thank you again, guys
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Jul 2013 19:51
The html form accepted the object passed into it and stored it as the userfile object named in the form and then passed that onto the index2.php file.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Oct 2013 18:23
Holy crud finally got this to work myself... I'm going to post something in the documentation to help folks out because this is goofy!

There's no need for any html form for this.
Just make sure you have the folder "upload" created in your server's root directory (in my case "C:\XAMPP\htdocs\upload"). And make sure that the file you are sending is stored in the app's media folder.

AGK Code:


PHP Script

This could probably use some security checks in place as this script will accept anything. It is also important to note that the index name for the file uploaded must be "myfile" as that is the name AppGameKit associates with it.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Oct 2013 18:49
Excellent! And a very nice example to work from.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Oct 2013 18:54

Login to post a reply

Server time is: 2024-05-07 16:29:24
Your offset time is: 2024-05-07 16:29:24