Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Upload File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam - 12 Feb 2008 15:22 GMT
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
Lars - 12 Feb 2008 15:55 GMT
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

> Hi all,
>
[quoted text clipped - 13 lines]
>
> Sam
Sam - 12 Feb 2008 16:20 GMT
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

> Hi
>
[quoted text clipped - 46 lines]
>>
>> Sam

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.