By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,401 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,401 IT Pros & Developers. It's quick & easy.

'Post'ing a file using JS

P: n/a
Hi all,

I am a novice in javascripting. I am writing a firefox plugin, in which
I have to upload a file as a post request to some website. I also need
to pass a password to the site.

I am using the XMLHttpRequest object to do it, but I could not figure
out how I send the file.
ie. do i do
XMLHttpRequestobject. send('&file=<file_loc>') which I feel is
obviously wrong.
-PJ.

Jun 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ja***********@gmail.com wrote:
Hi all,

I am a novice in javascripting. I am writing a firefox plugin, in which
I have to upload a file as a post request to some website. I also need
to pass a password to the site.

I am using the XMLHttpRequest object to do it, but I could not figure
out how I send the file.
ie. do i do
XMLHttpRequestobject. send('&file=<file_loc>') which I feel is
obviously wrong.
-PJ.


Hi,

Maybe first read a good introduction:
www.w3schools.com then select AJAX.

Regards,
Erwin Moller
Jun 29 '06 #2

P: n/a
Hi Erwin,

I did go through the w3schools tut on ajax but no help there especially
on post requests and none whatsover on how to send a file accross.
I have 'google'ed for this thing and not found much result.

-PJ.
Erwin Moller wrote:
ja***********@gmail.com wrote:
Hi all,

I am a novice in javascripting. I am writing a firefox plugin, in which
I have to upload a file as a post request to some website. I also need
to pass a password to the site.

I am using the XMLHttpRequest object to do it, but I could not figure
out how I send the file.
ie. do i do
XMLHttpRequestobject. send('&file=<file_loc>') which I feel is
obviously wrong.
-PJ.


Hi,

Maybe first read a good introduction:
www.w3schools.com then select AJAX.

Regards,
Erwin Moller


Jun 29 '06 #3

P: n/a
ja***********@gmail.com wrote:
Hi Erwin,

I did go through the w3schools tut on ajax but no help there especially
on post requests and none whatsover on how to send a file accross.
I have 'google'ed for this thing and not found much result.
Hi,

I don't know about developing FF plugins, but maybe this is relevant:
JS will not allow you to select files on the clients machine, and send then
to some server because of obvious security implications.
For a file to get submitted in a form, userinteraction is demanded by (not
broken) browsers, so the user knows excactly what is submitted.

Regards,
Erwin Moller

PS: Don't toppost

Because reading backward is difficult.
Why is that?
Topposting!
What is the most annoying thing on usenet?


-PJ.
Erwin Moller wrote:
ja***********@gmail.com wrote:
> Hi all,
>
> I am a novice in javascripting. I am writing a firefox plugin, in which
> I have to upload a file as a post request to some website. I also need
> to pass a password to the site.
>
> I am using the XMLHttpRequest object to do it, but I could not figure
> out how I send the file.
> ie. do i do
> XMLHttpRequestobject. send('&file=<file_loc>') which I feel is
> obviously wrong.
>
>
> -PJ.


Hi,

Maybe first read a good introduction:
www.w3schools.com then select AJAX.

Regards,
Erwin Moller


Jun 29 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.