PC Review


Reply
Thread Tools Rate Thread

Any method to upload file via POST?

 
 
Brett
Guest
Posts: n/a
 
      11th Mar 2005
Does any one have examples of how to upload a file via POST and also include
other form fields? Say two input boxes and a file type input.

I've tried:
WebRequest.Create()
and
System.Web.HttpUtility.UploadFile()

Neither provide seperation boundaries and that seems to fail the operation.
I am using "POST" for the method type.

Additionally, my header will come through like this:
Content-Disposition: form-data; name="file"; filename="something.csv"
Content-Type: application/octet-stream

When done through the web browser, it looks like this:
Content-Disposition: form-data; name="csvFile";
filename="C:\myFiles\something.csv"
Content-Type: application/octet-stream

I also changed the script that accepts the form to take in a field named
"file". Upload still didn't work. Anyway, any one that has uploaded a file
via POST, I'd appreciate an example.

Perhaps just sending HTML (with FORM tags) to the web server will work. I'd
like rather the above methods however.

Thanks,
Brett


 
Reply With Quote
 
 
 
 
gaidar
Guest
Posts: n/a
 
      11th Mar 2005
Hi, Brett,

Use multipart/form-data encoding type.
In form tag it looks like:
<form method="post" enctype="multipart/form-data">

Best regards,
Gaidar


"Brett" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Does any one have examples of how to upload a file via POST and also
> include other form fields? Say two input boxes and a file type input.
>
> I've tried:
> WebRequest.Create()
> and
> System.Web.HttpUtility.UploadFile()
>
> Neither provide seperation boundaries and that seems to fail the
> operation. I am using "POST" for the method type.
>
> Additionally, my header will come through like this:
> Content-Disposition: form-data; name="file"; filename="something.csv"
> Content-Type: application/octet-stream
>
> When done through the web browser, it looks like this:
> Content-Disposition: form-data; name="csvFile";
> filename="C:\myFiles\something.csv"
> Content-Type: application/octet-stream
>
> I also changed the script that accepts the form to take in a field named
> "file". Upload still didn't work. Anyway, any one that has uploaded a
> file via POST, I'd appreciate an example.
>
> Perhaps just sending HTML (with FORM tags) to the web server will work.
> I'd like rather the above methods however.
>
> Thanks,
> Brett
>



 
Reply With Quote
 
Brett
Guest
Posts: n/a
 
      11th Mar 2005
I am. No change.

Thanks,
Brett

"gaidar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, Brett,
>
> Use multipart/form-data encoding type.
> In form tag it looks like:
> <form method="post" enctype="multipart/form-data">
>
> Best regards,
> Gaidar
>
>
> "Brett" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Does any one have examples of how to upload a file via POST and also
>> include other form fields? Say two input boxes and a file type input.
>>
>> I've tried:
>> WebRequest.Create()
>> and
>> System.Web.HttpUtility.UploadFile()
>>
>> Neither provide seperation boundaries and that seems to fail the
>> operation. I am using "POST" for the method type.
>>
>> Additionally, my header will come through like this:
>> Content-Disposition: form-data; name="file"; filename="something.csv"
>> Content-Type: application/octet-stream
>>
>> When done through the web browser, it looks like this:
>> Content-Disposition: form-data; name="csvFile";
>> filename="C:\myFiles\something.csv"
>> Content-Type: application/octet-stream
>>
>> I also changed the script that accepts the form to take in a field named
>> "file". Upload still didn't work. Anyway, any one that has uploaded a
>> file via POST, I'd appreciate an example.
>>
>> Perhaps just sending HTML (with FORM tags) to the web server will work.
>> I'd like rather the above methods however.
>>
>> Thanks,
>> Brett
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Upload Post Back tshad Microsoft ASP .NET 0 14th Feb 2007 06:50 PM
What is the Proper Method to Upload Long File - WEBDAV using PUT Method Jitendra Sanghani Microsoft ASP .NET 0 27th Feb 2006 10:18 AM
problem using "post" method for upload =?Utf-8?B?WmFjaG92aWNo?= Microsoft Dot NET Framework 3 13th Dec 2005 08:45 PM
How to upload file via HttpWebRequest POST? Brett Microsoft VB .NET 0 9th Mar 2005 05:11 PM
Large file upload to server (webdav/http file post/other?) Weston Weems Microsoft Dot NET Framework 0 25th Jan 2005 04:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:57 PM.