View previous topic :: View next topic |
Author |
Message |
Wincefish
Joined: 07 Jan 2009
Posts: 2
WR Updates: 0
Wincefish WR Profile
|
Posted: Wed Jan 07, 2009 1:07 pm Post subject: Uploading data via POST -- username? |
|
|
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? |
|
Back to top |
|
 |
Rollie
Site Admin

Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile
|
Posted: Wed Jan 07, 2009 1:32 pm Post subject: |
|
|
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 _________________ phpbb:phpinfo() |
|
Back to top |
|
 |
Kosh
Census Taker
Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile
|
Posted: Sat Jan 31, 2009 1:34 am Post subject: |
|
|
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: | 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: |
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? |
|
Back to top |
|
 |
Rollie
Site Admin

Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile
|
Posted: Sat Jan 31, 2009 4:14 pm Post subject: |
|
|
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 =) _________________ phpbb:phpinfo() |
|
Back to top |
|
 |
Kosh
Census Taker
Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile
|
Posted: Sun Feb 01, 2009 12:05 am Post subject: |
|
|
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: | 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 |
|
|
Back to top |
|
 |
Rollie
Site Admin

Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile
|
Posted: Sun Feb 01, 2009 12:31 am Post subject: |
|
|
Hmm... can you email me, rollie (at) warcraftrealms.com and get me more info on your post? _________________ phpbb:phpinfo() |
|
Back to top |
|
 |
Kosh
Census Taker
Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile
|
Posted: Sun Feb 01, 2009 8:09 pm Post subject: |
|
|
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:1 .
If you weren't working on the PHP script before that time, then I suppose it's just a transitory glitch. |
|
Back to top |
|
 |
|
|