Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Help with uploadind file to server using FileSystemobject


Message #1 by "Eoin Hayes" <Hayes_Eoin@e...> on Wed, 24 Apr 2002 19:45:37
I am a beginner to ASP so bear with me.
I have a simple web page, which allows the user to upload a file (of any 
extension type including .img) from their computer to a fileserver. I want 
to use the FileSystemObject to do this and not use any third party 
products. How do I do this?I want the uploaded file to be put in a folder 
that is the same as the value of the session no.

Here is my simple code so far
 


<HTML>
<head>
<TITLE>File Upload</TITLE>
</HEAD>
<body>
<center>

</form>
<form action="insert.asp" method="get" enctype="multipart/form-data" 
id=form1 name=form1><BR>
<p>Please select a file to attach if desired</p>
<p><b>File: </b><input type="file" style="width: 300;" 
name="thefile"></p>
<input type="submit" value="Upload" id=submit2 name=submit2></form>

</center>

<%
Dim strfile, path, strFilename

Set fso = Server.CreateObject("Scripting.FileSystemObject")



strFilename = Session("cabSN")
path = "\\fileserver\UploadedFiles\" & strFilename & "\"


%>

</body>
</html>

  Return to Index