Page 1 of 1
Uploading data via POST -- username?
Posted: Wed Jan 07, 2009 1:07 pm
by Wincefish
I'm looking at the POST form on the Upload page to try and make simple Perl script to upload census scans. (I figure it will be simpler and more portable than UniUploader. And yes, if I can get it to work, I'll definitely open source it.)
In the POST form there are "name" fields for the Census file ("userfile") and the Killing Fields file ("bg_file"), but there don't seem to be any field for a WarcraftRealms username.
I'm guessing you're doing this with cookies right now, but is there any way to expose the username as a field in the POST form? Or is it already exposed, but just not used in the Upload script?
Posted: Wed Jan 07, 2009 1:32 pm
by Rollie
You'll want to tie into the uniupload area instead.
URL:
http://www.warcraftrealms.com/uniupload.php
POST variables:
CensusPlus - The Census data
WR_KillingFields - Killing fields data
user - your WR username
pw - your WR password
Posted: Sat Jan 31, 2009 1:34 am
by Kosh
Seeing the POST variables documented inspired me to whip up a script to compress & upload my own file. I was about to dig up how to do it in PHP when I remembered that the trusty old curl could submit as well as fetch URLs. I can post the shell script later if anyone is interested, but the username / password part of the upload doesn't seem to be working. Here's the relevant command:
Code: Select all
curl -F CensusPlus=@CensusPlus.lua.gz -F user=Kosh -F pw=**password** http://www.warcraftrealms.com/uniupload.php
, and here's the output I'm receiving:
Code: Select all
Looking for file
IP: *.*.*.*<br>
United States<br>
*.*.*.* - us -
File appears to be valid, checking your version number.
Checking your file
Found CensusPlus Database
Found CensusPlus Info Data
Found Version Number => Version: 4.2.0 <Found> Locale: US <=
Attempting to make entry
Getting User/pass
Username : Kosh<=
Sorry, unable to determine login. Either no login was supplied or login/password not found.
Version check complete!
Thank you for submitting your file!
It will be processed soon and the data will be added to all listed data!
Looking for WR_KillingFields
No file found
The only things modified are the password & IP address. Note that it
did properly handle a gzipped file.
So, even though it seems to have found my username, it didn't like it or didn't find the password. Is it possible one or both of them are looking for variables with a different name?
Posted: Sat Jan 31, 2009 4:14 pm
by Rollie
No, it is looking for either 'pw' or 'password'.
I have added an output for the password if you also pass in the variable test=1 also.
Hopefully that will help you figure out the problem =)
Posted: Sun Feb 01, 2009 12:05 am
by Kosh
Thanks, that helped me uncover a stupid error on my part (unescaped special characters).
Now that I've fixed that, I am now seeing the following at the end of the response:
Code: Select all
Error => Unable to query : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 on line: 285 of /home/wrlogin/public_html/uniupload.php
Posted: Sun Feb 01, 2009 12:31 am
by Rollie
Hmm... can you email me, rollie (at) warcraftrealms.com and get me more info on your post?
Posted: Sun Feb 01, 2009 8:09 pm
by Kosh
Sorry, didn't check back until now; I can email you if you still want me to, but the same error occurred either with or without "test=1" (which doesn't surprise me, since that shouldn't have any effect on the SQL you're assembling).
Note that a later submission (using the same curl code) was successful, and shows up in my "updates" list (it's the one at Feb 01, 09 01:41:18).
If you weren't working on the PHP script before that time, then I suppose it's just a transitory glitch.