Upload

For questions about using Classic.

Post » Fri Jan 28, 2011 8:51 pm

In a program I'm making I would need to upload a database(when finished working) to a website and download it again on start up of the program. Download Object looks self-explanatory, but how to upload. I suppose HTTP Object is intended for this, but I don't understand it. Could anyone help me, and briefly explain it to me?
Let's say, I want to upload mydatabase.dat to mysite.com
In actions there is:
1. Add file - what argument name means? (same with add number and string)
2. Set user agent - what is it and usage?
3. Requests - what is it and usage?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon Jan 31, 2011 12:09 pm

Help anybody? I'll probably need user name and password to communicate with the server and upload the file, is it safe with Construct? How can I do it? Is it possible with events or Python only?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon Jan 31, 2011 3:18 pm

Online functionality is one of the bigger weaknesses of Construct.

Of course the Download object does its job fine for downloading, but I'm afraid there is no object that is able to directly upload files.

With the HTTP Object you can communicate with websites, such as passing arguments through a PHP script/HTML form. I've used it before to create a simple flatfile highscore table.

I haven't used the object in quite a while, but together with a proper PHP upload script, it should be able to get the job of uploading a file done.

[quote="Noga":96bux2j8]In actions there is:
1. Add file - what argument name means? (same with add number and string)
2. Set user agent - what is it and usage?
3. Requests - what is it and usage?[/quote:96bux2j8]

1. See above - adding arguments when you post to a site basically. Like it could pass the username, a password and a message, all being different arguments.
2. User agent would be the string which is used to identify your browser, to be able to choose the appropriate content to display for example.
3. 'Get' and 'Post' would obviously refer to the HTTP methods of the same names. Take a look here maybe. With 'Get' you could also download any site as a string, which would be returned in the expression 'HTTP.GetResponse'. And with 'Post', well, you usually post stuff. :P

Keep in mind that I'm no authority on these online matters though, I hope I was able to provide some insight at least. Anyone able to add to that or correct me by all means do post!
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Feb 01, 2011 6:14 pm

Thanks for your help, I've solved it, kind of, so when I'm finished with it I'll post it here.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests