Re: upload file using webbrowser

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 09/13/04


Date: Mon, 13 Sep 2004 11:07:00 -0400


"Banli" <banli_gao@hotmail.com> wrote in message
news:590e02b9.0409110714.16052d68@posting.google.com
> Can anyone tell me how can I programmly set the file name and submit
> the form to upload the file using webbrowser control?

You cannot. An ability for the script to upload an arbitrary file
without user's knowledge or consent would be a huge security hole, and
thus prohibited.

See KB Article KB167658 "HOWTO: Automate Internet Explorer to POST Form
Data". You will have to read the file yourself and manually build the
POST data in the correct format.

-- 
With best wishes,
    Igor Tandetnik
"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage


Relevant Pages

  • Re: post image to webhoster - upload file with http
    ... I want to upload an image to imageshack in C++. ... where I can specify a url, post data and header. ... String boundary, sHeader, sPostData, sFileContent; ...
    (alt.php)
  • able to upload 28 meg file, yet php.ini limits posts to 10 megs. What is up with that?
    ... Maximum size of POST data that PHP will accept. ... However, I was assuming that the upload should have failed, before the PHP script ever had the chance to resize the file. ... But I've never seen Plesk undermine the importance of the post_max_size setting, nor can I imagine where Plesk might store such a conf setting if it did. ...
    (comp.lang.php)
  • I am able to upload a 28 meg file, yet php.ini limits posts to 10 megs. What is up with that?
    ... Maximum size of POST data that PHP will accept. ... However, I was assuming that the upload should have failed, before the PHP script ever had the chance to resize the file. ... But I've never seen Plesk undermine the importance of the post_max_size setting, nor can I imagine where Plesk might store such a conf setting if it did. ...
    (comp.lang.ruby)
  • RE: [PHP] More info on timeout problem
    ... [PHP] More info on timeout problem ... and nothing I do seems to let me upload anything larger than a 2MB file. ... Sets max size of post data allowed. ... This setting also affects file upload. ...
    (php.general)