473,671 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any method to upload file via POST?

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.Crea te()
and
System.Web.Http Utility.UploadF ile()

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="somet hing.csv"
Content-Type: application/octet-stream

When done through the web browser, it looks like this:
Content-Disposition: form-data; name="csvFile";
filename="C:\my Files\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
Nov 21 '05 #1
2 1724
Hi, Brett,

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

Best regards,
Gaidar
"Brett" <no@spam.com> wrote in message
news:ue******** *****@TK2MSFTNG P15.phx.gbl...
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.Crea te()
and
System.Web.Http Utility.UploadF ile()

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="somet hing.csv"
Content-Type: application/octet-stream

When done through the web browser, it looks like this:
Content-Disposition: form-data; name="csvFile";
filename="C:\my Files\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

Nov 21 '05 #2
I am. No change.

Thanks,
Brett

"gaidar" <ga****@vbstree ts.ru> wrote in message
news:eG******** ******@TK2MSFTN GP10.phx.gbl...
Hi, Brett,

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

Best regards,
Gaidar
"Brett" <no@spam.com> wrote in message
news:ue******** *****@TK2MSFTNG P15.phx.gbl...
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.Crea te()
and
System.Web.Http Utility.UploadF ile()

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="somet hing.csv"
Content-Type: application/octet-stream

When done through the web browser, it looks like this:
Content-Disposition: form-data; name="csvFile";
filename="C:\my Files\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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5592
by: Pedro Carvalho | last post by:
I am using a WebClient.Upload File method (using the HTTP POST) on the Client side and, to accept posted files on the Server side, I am using an ASP.NET page with the following code: void Page_Load(object sender, EventArgs e) { foreach(string f in Request.Files.AllKeys) { HttpPostedFile file = Request.Files; file.SaveAs("c:\\WUTemp\\" + file.FileName);
0
1978
by: Emil | last post by:
I am looking for a HTTP Client library for C++ that I can use to upload files by using the POST method to a PHP-script on my server. I am currently using QT's QHttp but I cant seem to get file uploads to work. This is the functionality I want: <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file"> </form>
4
14821
by: Evgeny Zoldin | last post by:
Hi ALL. I would like to download file from some web-server that requires Basic-Authetication, change somthing in the file and upload it back to the server. I can download the file and proceed as I need, but how should I upload it back? Server provides standard HTML GUI for Browsers where client can fill appropriate input field of the form with a full name of the local file. The form uses POST method to upload file and has attribute
3
12115
by: sushi | last post by:
Hello, I am trying to use WebClient class's UploadData method for uploading data to a particular uri. I ahve created a text file say new.txt in the IISROOT folder. But when I try to upload data to this file using uri http://localhost/new.txt it gives following exception Uploading to http://localhost/new.txt ... The remote server returned an error: (405) Method Not Allowed. at System.Net. HttpWebRequest.CheckFinalStatus()
9
3825
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
2
2154
by: Event Horizon | last post by:
Hi, I'm trying to add an simple upload applet to shopping cart script. My new applet form sends all needed post fields ( quantity, product, etc... ) but the "file" post field is hardcoded in applet. Shop script works with : <input type="file" name="id"/> but not with applet's: <input type="file" name="SourceFile_1"/> I just cannot figure out how to fix this :(
0
1849
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1- <SCRIPT TYPE="text/javascript"> function popupform(myform, windowname)
5
1867
by: Bob Bedford | last post by:
Hi all, I've to accept a file that is sent using a POST method. The file will be sent using this URL: http://username:pass@www.mysite.com/upload.php How can I retrieve the username and passord and rename the file ? Should I use substring using the URI ? Pseudocode below is the best way to do so ?
3
613
by: shapper | last post by:
Hello, I need to upload a file. Can I only do this with the File Upload control? I also need the following: - Send upload info, upload percentage, continuously to a JavaScript function so I can display the Upload Progress.
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8402
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6237
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.