Upload File

S

Sam

Hi all,

We have an old web application written in java and we want to convert this
application to .net. this app stores straight html content forms in our
database. These forms then get loaded based on each customer id in the
request.

The problem I'm facing right now is that, when a form has an "user upload"
file option, I don't find a way in .Net to save the "user upload" file on
our server from these html form without rebuilding data and the application
entirely. This is because these form were saved in straight html tags (such
as <input name="myfile" type="file" value="" />. ) Does anyone have any
ideas how to get around this with .Net?

Regards,

Sam
 
L

Lars

Hi

I'm a newbie to .Net but the other day I found out some thing intresting.
The DataList was able to solve my problem with showing HTML code stored in
my database in a matter to make sence for the user.

Couldn't you just store the HTML uploaded files to your database.
There should be a way to read what's posted back to the page by the Request
function. I think I saw that in an instruction video.

I just tested to add a form to a .Net page and failed to run the page since
a page can only have one form.

WHy not use thordinary old html file and post it to a ASP page.

<html>
<body>
<!-- HTML Code -->
<form action="myScript.aspx">
<input name="myfile" type="file" value="" />
<input type="submit" value="submit" text ="Submit" />
</form>
<!-- HTML Code -->
</body>
</html>

Then take care of storing adding the file to a database in the ASP file. I
racall that you can use the similar to $_POST in PHP scripts in ASP.NET when
the page loads. But you might have to check in LoadPage if it's a post back
or not.


Lars
 
S

Sam

Hi Lars

I can post back the html form to the server but without the hidden view
state generated by asp.net, I can't read data of the file either through
input stream or from the file property of the request object.

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top