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 / Send files through http

Author
Message
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 21st May 2018 09:23
Hello forum,

Another question that I have is regarding sending a file created in AppGameKit through open to write.

I've found on this forum a server file for the command and I managed to put some code for transferring but i don't see the file on my server. My server is from my website, I can access it through FTP in FileZilla. Is it possible through such server, or it must a server with other capabilities?

Here is the code:



Server File:



Thank you very much!
www.alexmatei.com
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 21st May 2018 21:32
Remove all of the comments before the <?php tag in the PHP file, or the server will likely detect the script as standard text and not execute the commands. (You can move them to below the opening php tag if you wish instead of deleting them.)

Make sure you have manually created an "upload" folder on the server in the same directory as server.php.

Your AppGameKit script never sets "done" to 1 so the repeat loop will never exit. You will also want to check if GetHTTPResponseReady equals -1 as well as 1 or otherwise if there is an error with the request the loop will never break.
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 22nd May 2018 10:23
Hello xCept,

Thank your for your response!

Is it ok to put my website with ".com" instead of the ip address?

In the meantime, I did that and the output threw me this: (picture attached in this message)

As for the variable "done": Response is 0 at the end.

Thank you and I'll be waiting any response!
www.alexmatei.com

Attachments

Login to view attachments
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 22nd May 2018 10:33
And now this: (picture attached to this message)
www.alexmatei.com

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd May 2018 14:08 Edited at: 22nd May 2018 14:42
Quote: "Is it ok to put my website with ".com" instead of the ip address?"

Yes.

I tested the script and it works fine on my server, so it's an issue with your server configuration.

As a side note, keep in mind if you want to actually keep the uploaded file on the server, you should move it from the tmp directory to a more permanent location.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 23rd May 2018 09:40
I understand, maybe it must be the configuration, but by the way, I also have some login credentials. Do I must paste them into the application or it can work by itself?
www.alexmatei.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th May 2018 22:31
Well if you can't access the page without logging in, then how do you think the script is going to access the page? If you want to prevent unauthorized access to the page, you're going to have to customize the script a bit. Include POST data of the username and password then handle the credentials in the php script to check authorization before accepting the file upload. And since POST data is still viewable, make sure to salt the password before transmission. Never send a password in plain text. Ideally, you'd want an SSL connection if you're sending login information.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
MateiSoft
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 25th May 2018 10:59
Thank you for your response Phaelax! I'll try modify the PHP and I think it will work after tht since I forgot about the credentials to be given!
www.alexmatei.com

Login to post a reply

Server time is: 2024-11-18 12:37:04
Your offset time is: 2024-11-18 12:37:04