Created
December 19, 2010 04:25
-
-
Save aredridel/747099 to your computer and use it in GitHub Desktop.
Form file upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http') | |
var cl = http.createClient(80, 'dinhe.net'); | |
var req = cl.request('POST', '/~aredridel/t.php', | |
{ host: 'dinhe.net', 'Content-Type': 'multipart/form-data; boundary=----asd123' }) | |
req.write('------asd123\r\nContent-Disposition: form-data; name="file"; filename="test.txt"\r\nContent-Type: application/octet-stream\r\n\r\n') | |
req.write("Testing 123\r\n") | |
req.write("------asd123--r\n") | |
req.end() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment