|
-
May 7th, 2003, 06:31 AM
#1
Thread Starter
New Member
Save and Open the Uploaded file ?
Hi all,
I have an ASP.NET project using VB.NET.
My application will allow user to upload multiple attachments.(any type of files)
All the uploaded files will be store in the server(folder) for futher retriving.
Later, user can open the download file by clicking a hyperlink from a page.
Anyone have any idea and advice on how to do this ?
Any tutorial or samples that I can refer to ?
How can I Save and Open a file to and from a folder?
Thanks.
Regards,
Hean
-
May 7th, 2003, 10:56 AM
#2
Registered User
Here's some code that might help.
<asp:label id="Label1" runat="server">Select a file to upload: </asp:label><input id="uploadedFile" type="file" name="uploadedFile" runat="server">
Code Behind:
Imports System.IO
strFileName = uploadedFile.PostedFile.FileName
Dim myFileName As String = System.IO.Path.GetFileName(strFileName)
uploadedFile.PostedFile.SaveAs("c:\inetpub\wwwroot\foldername\filename\")
-
May 8th, 2003, 12:24 AM
#3
Thread Starter
New Member
Thanks.
But it only for Save file.
I still look for how to Open the file....
-
Oct 26th, 2004, 04:06 PM
#4
Hyperactive Member
Originally posted by jl39775
Here's some code that might help.
<asp:label id="Label1" runat="server">Select a file to upload: </asp:label><input id="uploadedFile" type="file" name="uploadedFile" runat="server">
Code Behind:
Imports System.IO
strFileName = uploadedFile.PostedFile.FileName
Dim myFileName As String = System.IO.Path.GetFileName(strFileName)
uploadedFile.PostedFile.SaveAs("c:\inetpub\wwwroot\foldername\filename\")
Thanks for this code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|