Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm using the Pure ASP upload scrip 1

Status
Not open for further replies.

walderr

Programmer
Jul 18, 2003
32
GB
I'm using the Pure ASP upload script provided on
I've got the script to work in that it picks up the filename/type and size to the confirmation screen, which also submits other data from the form to a database. However, it doesn't actually upload the file, which defeats the object somewhat!

The first portion of script is as follows - anyone got any idea where the problem lies? Thanks in advance:

<!-- #include file=&quot;upload.asp&quot; -->
<%
' Create the FileUploader
Dim Uploader, File

Set Uploader = New FileUploader
' This starts the upload process
Uploader.Upload()

' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
Response.Write &quot;File not uploaded.&quot;
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items

' Save the file
File.SaveToDisk &quot;C:\Documents and Settings\walderrm\My Documents\&quot;&quot; & File.FileName & &quot;&quot;&quot;

' Output the file details to the browser
Filename = &quot;&quot; & File.FileName & &quot;&quot;
FileSize = &quot;&quot; & File.FileSize & &quot;&quot;
FileContentType = &quot;&quot; & File.ContentType & &quot;&quot;
AddDocPath = &quot;&quot;& File.FileName &&quot;&quot;
Next
End If
%>

<html>
<head>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<%If type_of_submit = &quot;Amend&quot; then
Response.Write &quot;<title>Update Successful</title>&quot;
else
Response.Write &quot;<title>Upload Successful</title>&quot;
end If
%>
<style TYPE=&quot;text/css&quot;><!--A { text-decoration: none }A:hover { color:Red}--></style>
<title>Success!</title>
<meta name=&quot;Microsoft Theme&quot; content=&quot;apo-blue 1000, default&quot;>
</head>

<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>

<%
AddIDNumber = Uploader.Form(&quot;AddIDNumber&quot;)
AddDocTitle = Uploader.Form(&quot;AddDocTitle&quot;)
AddApprover = Uploader.Form(&quot;AddApprover&quot;)
IDNumber = Uploader.Form(&quot;IDNumber&quot;)
DocTitle = Uploader.Form(&quot;DocTitle&quot;)
DocPath = Uploader.Form(&quot;DocPath&quot;)
Approver = Uploader.Form(&quot;Approver&quot;)
SeqNumber = Uploader.Form(&quot;SeqNumber&quot;)
 
Try this one. Of the three versions on that page ( this one is the best: You may have to sign up at Planet Source Code to get at the code. It's free though.

There's an Access database and examples of uploading to a folder or to the database. Very easy to use. Relatively fast compared to the other two.
 
I worked it out in the end, it was just that all the folders I was trying must have had security permissions set. I can upload to a few servers, but not the ones I want, so I'm guessing I'll need to speak to our IT security people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top