Quantcast

Jump to content

» «
Photo

Upload save to gtasnp from ASI?

3 replies to this topic
ThirteenAG
  • ThirteenAG

    Soldier

  • Feroci Racing
  • Joined: 29 Dec 2008
  • None

#1

Posted 27 September 2013 - 04:41 PM

Hey, can someone confirm that this is possible? I checked some different ways to upload files, but with no success.
My goal is to grab .b file from hard drive, and upload it to http://gtasnp.com/ ingame(or at least from console app, for testing purposes).

Headers:

http://gtasnp.com/upload

POST /upload HTTP/1.1
Host: gtasnp.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://gtasnp.com/home
Cookie: sess=a92813a5ace1e1c58da6b14eb5467c76
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------283722930812491
Content-Length: 203069
-----------------------------283722930812491
Content-Disposition: form-data; name="max_file_size"

2097152
-----------------------------283722930812491
Content-Disposition: form-data; name="file"; filename="GTASAsf1.b"
Content-Type: application/octet-stream

BLOCKuЃЪ5Nines and AK's   //the rest of the file is skipped
HTTP/1.1 302 Moved Temporarily
Date: Fri, 27 Sep 2013 16:25:07 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Set-Cookie: sess=a92813a5ace1e1c58da6b14eb5467c76; expires=Sun, 27-Oct-2013 16:25:12 GMT; path=/
Location: http://gtasnp.com/download/39524
Keep-Alive: timeout=5, max=75
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------
http://gtasnp.com/download/39524

GET /download/39524 HTTP/1.1
Host: gtasnp.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://gtasnp.com/home
Cookie: sess=a92813a5ace1e1c58da6b14eb5467c76
Connection: keep-alive

HTTP/1.1 200 OK
Date: Fri, 27 Sep 2013 16:25:13 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Set-Cookie: sess=a92813a5ace1e1c58da6b14eb5467c76; expires=Sun, 27-Oct-2013 16:25:13 GMT; path=/
Keep-Alive: timeout=5, max=75
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#2

Posted 27 September 2013 - 05:30 PM

Sure, it's possible.
Use CURL library for Win32 - MSVC: http://curl.haxx.se/download.html

Making it work in-game may be a bit harder than making a console app.
The biggest obstacle in your project may be insufficient knowledge about HTTP protocol and CURL library.

xNCx
  • xNCx

    Street Cat

  • Members
  • Joined: 15 May 2008
  • None

#3

Posted 27 September 2013 - 07:11 PM

Maybe you should contact the admin of gtasnp and ask if he can allow your tool to upload files in a different way?


ThirteenAG
  • ThirteenAG

    Soldier

  • Feroci Racing
  • Joined: 29 Dec 2008
  • None

#4

Posted 28 September 2013 - 10:30 AM

Thanks to vScherba, here's a working prototype: http://habrahabr.ru/...#comment_224468 (in case anyone else is interested).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users