473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Posting a File Via HTML


I have a need to send a file via a POST and am looking for some information.

As an example:

A user will be displayed an ASPX page
-- The user will select a file.
-- The file will then be read.
-- A URL Post string will be created
http://www.someWebSite.com/imageProc...e=myImage1.jpg
-- The data from the file will be sent to the website for processing.

I am looking for any information on if this is possible, and how to do this (website that explains,
pseudocode, working example, etc)

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)

Nov 18 '05 #1
4 991
It's called an upload... It's complex because you have to manage rights on
the server to allow the user of our appPool to write there...
BE CAREFULL TO AVOID TO LET THE EXECUTE RIGHT (It's a big security hole)
Someone could post an exe (like tryan or virus and execute it)

There is somme good exemple in ast dot Net startup kit...

regards...

LJ

"David Elliott" <Da**********@BellSouth.net.nospam> a écrit dans le message
de news: qn********************************@4ax.com...

I have a need to send a file via a POST and am looking for some information.
As an example:

A user will be displayed an ASPX page
-- The user will select a file.
-- The file will then be read.
-- A URL Post string will be created
http://www.someWebSite.com/imageProc...e=myImage1.jpg -- The data from the file will be sent to the website for processing.

I am looking for any information on if this is possible, and how to do this (website that explains, pseudocode, working example, etc)

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)

Nov 18 '05 #2
In the HTML


In the Code Behind, something like

Private Sub upload_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles upload.ServerClick
Dim strSavePath As String = Request.PhysicalApplicationPath &
ConfigurationSettings.AppSettings("CustomerRootFol der") &
Session.Item("CustomerID") & "\"
Dim intReturn As Integer
SaveRecord()

If Not uploadedFile.PostedFile.FileName = vbNullString Then
If Not (uploadedFile.PostedFile Is Nothing) Then
Try
Dim postedFile = uploadedFile.PostedFile
Dim filename As String = Path.GetFileName(postedFile.FileName)
Dim contentType As String = postedFile.ContentType
Dim contentLength As Integer = postedFile.ContentLength
postedFile.SaveAs(strSavePath & strFileName)

"David Elliott" <Da**********@BellSouth.net.nospam> wrote in message
news:qn********************************@4ax.com...

I have a need to send a file via a POST and am looking for some information.
As an example:

A user will be displayed an ASPX page
-- The user will select a file.
-- The file will then be read.
-- A URL Post string will be created
http://www.someWebSite.com/imageProc...e=myImage1.jpg -- The data from the file will be sent to the website for processing.

I am looking for any information on if this is possible, and how to do this (website that explains, pseudocode, working example, etc)

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)

Nov 18 '05 #3
I was mistaken, the user will provide their own HTML page through whatever
method. They will click on a link or button and the file will be sent to me for
processing. Also, the server side solution can not be a webservice.

Since I won't be generating the page via ASPX, I will not be able to use the
HtmlInputFile class.

So this is a 2 part question now.

1) How to post a file strictly through HTML?
2) How to process it on the server side?

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)
On Fri, 5 Mar 2004 17:05:19 +0100, "\(Laurent Jordi\)" <la*****@ezlogic.mc> wrote:
It's called an upload... It's complex because you have to manage rights on
the server to allow the user of our appPool to write there...
BE CAREFULL TO AVOID TO LET THE EXECUTE RIGHT (It's a big security hole)
Someone could post an exe (like tryan or virus and execute it)

There is somme good exemple in ast dot Net startup kit...

regards...

LJ

"David Elliott" <Da**********@BellSouth.net.nospam> a écrit dans le message
de news: qn********************************@4ax.com...

I have a need to send a file via a POST and am looking for some

information.

As an example:

A user will be displayed an ASPX page
-- The user will select a file.
-- The file will then be read.
-- A URL Post string will be created

http://www.someWebSite.com/imageProc...e=myImage1.jpg
-- The data from the file will be sent to the website for processing.

I am looking for any information on if this is possible, and how to do

this (website that explains,
pseudocode, working example, etc)

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)


Nov 18 '05 #4
Search for the file upload capabilites of ASP.Net You could upload
the file then process it as you need to.

Neil

David Elliott <Da**********@BellSouth.net.nospam> wrote in message news:<qn********************************@4ax.com>. ..
I have a need to send a file via a POST and am looking for some information.

As an example:

A user will be displayed an ASPX page
-- The user will select a file.
-- The file will then be read.
-- A URL Post string will be created
http://www.someWebSite.com/imageProc...e=myImage1.jpg
-- The data from the file will be sent to the website for processing.

I am looking for any information on if this is possible, and how to do this (website that explains,
pseudocode, working example, etc)

Thanks,
Dave

Da**********@BellSouth.net.nospam (Remove .nospam if responding directly)

Nov 18 '05 #5

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

Similar topics

2
by: Jacques Cooper | last post by:
Hello, How do I upload a disk file using HTML? For example, many job boards allow you to upload your resume to their site. Thanks, Jacques
1
by: Bart Schelkens | last post by:
Hi, has anyone of you used the "file html control" before ? This control should allow you to upload files to the server from within your browser. It works fine, the upload I mean. But I also...
3
by: ChainsawDude | last post by:
I am posting from a HTML form (below) to a aspx webform. This works OK but I notice the £ character (pound sign) is dropped! i.e. not picked up by a Request.Form in the webform e.g. input =...
2
by: Rabbit | last post by:
Dear All, I've been tried various configuration and did install SP1 on Windows 2003 Server. The problem now that I have is an aspx page located on the web site for taking the file post by...
0
by: Rabbit | last post by:
Dear all, My application contains 2 parts(Server and Client), the server side is having a ASP.net page as listener for client side to post file, the main coding to receive posting file as...
2
by: Steve Peterson | last post by:
Hello I have a problem with posting from a .htm page to a .aspx page. In the "normal" .htm page I have a standard post form and input button. The form action attribute is set to the .aspx page...
1
by: desi.american | last post by:
I have a dynamically generates ASPX page with tables and data. Depending on user selection, the same page can be viewed as a simple web page (rendered in HTML) or as an excel spreadsheet. If the...
0
by: sharif | last post by:
Anyone could help me out for n=my code ......I have written following code ,Here i m able to get and post the form successfuly..but after posting im not gettng proper response content... ...
1
by: Theadmin77 | last post by:
Currently i have a DEFAULT.htm file that display 2 htm frames , FRAME1.htm and FRAME2.htm. 1.FRAME 1.htm present a form to fill up a sql query and pass info to a "MYQUERY.cfm" 2.MYQUERY.cfm...
2
by: =?Utf-8?B?Q29yeSBKLiBMYWlkbGF3LCBCZXlvbmQwMS5jb20= | last post by:
Hello! I need to retrieve POST information from an HTML form into my VB ASP.net 2008 web form. My simple html form is: <form action="webform1.aspx" method="post" name="Form1"> <input...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.