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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any free asp upload component?

Status
Not open for further replies.

siena

Technical User
Jan 30, 2003
262
US
Hello everyone!
I have just spent a painful 2 weeks using aspload component to develope a web app that would allow users to upload files to their server, modify upload files, delete uploaded files and list files.
The file type we worked on is a pdf file.

I just found out now that the component I downloaded and installed from persist Upload is a trial version.
Does anyone know if there is any release of aspupload that is free?
Right now, the users can't use this app anymore until I rewrite it completely or find a free component to install.
This is bad.
Any suggestion would be greatly appreciated.
Thanks,
 
ASPsimpleupload:


hth,
Foxbox
ttmug.gif
 
Thanks a lot for the quick response.
I was wondering if the component you sent me is comparable with the code I am using.
I installed it but when I run the code, I got this error:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/job/File_Upload1.asp, line 5

Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at:
Same error I was getting a month ago when I first wrote this code and tried running it.
This led to my uploading and installing aspUload component from persists.
Here is the line of code where this error is occuring.
Set Upload = Server.CreateObject("Persits.Upload.1")
 
you must register ASPSimpleUpload.DLL

[regsvr32 ASPsimpleupload (in the folder with the DLL)]

If you installed it default, check the documentation and examples in c:\program files\aspsimpleupload.

The server object you must create is:
set upload = server.createobject("ASPsimpleUpload.upload")


hth,
Foxbox
ttmug.gif
 
Before I delve into your into aspSmartUpload I want to make sure that I have done all I could with aspSimpleUpload component.
Right now, it is having problems with this code snippet
I keep getting this error:

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Upload.SetMaxSize'

/job/File_Upload1.asp, line

Below is the lines that are causing problem.

If I can replace these with whatever aspsimpleUpload version of it is, then I think I will be alright.


uploaddir = "Upload" ' Folder where they will store the files.

UPLOADDIRECTORY = Server.MapPath(uploaddir)
Set Upload = Server.CreateObject("ASPSimpleUpload.Upload")
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.OverwriteFiles = True
Count = Upload.Save(UPLOADDIRECTORY)

Set File = Upload.Files("File1")
If Not File Is Nothing Then
'Response.Write File.ExtractFilename
Filename = File.ExtractFilename
Filesize = File.Size
contentType = File.Ext 'UCase(Right(File.Path, 3))
fileData = File.Binary
else
Filename = ""
End If
 
i suggest you start by running this EXAMPLE:

<%
Dim upl, NewFileName

Set upl = Server.CreateObject(&quot;ASPSimpleUpload.Upload&quot;)

If Len(upl.Form(&quot;File1&quot;)) > 0 Then
NewFileName = &quot;/Uploads/&quot; & upl.ExtractFileName(upl.Form(&quot;File1&quot;))
If upl.SaveToWeb(&quot;File1&quot;, NewFileName) Then
Response.Write(&quot;File successfully written to disk.&quot;)
Else
Response.Write(&quot;There was an error saving the file to disk.&quot;)
End If
End If
%>

<html><head><title>ASP Simple Upload Example #1</title></head></title>
<body>
<form method=&quot;POST&quot; action=&quot;Example1.Asp&quot; enctype=&quot;multipart/form-data&quot;>

Select a file to upload: <input type=&quot;file&quot; name=&quot;File1&quot; size=&quot;30&quot;>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Upload Now&quot;>
</form>
</body>
</html>


hth,
Foxbox
ttmug.gif
 
Didn't have any problems with that as it is written to disk, at least according to the user-defined message.
 
i see a couple of differences between the code that works, and yours.
&quot;Object doesn't support this property or method: 'Upload.SetMaxSize' &quot; is a nice hint.
Try to look that up in the documentation!


hth,
Foxbox
ttmug.gif
 
TheWebDataGuy,
Ok, the codes here are similar to the one I am currently using.
The only reason I am using aspUpload component right now is because I can modify an existing file. As indicated, the file extension we are using is pdf.
Once the pdf files are uploaded, they can be opened for reading using adobe acrobat reader.
If the user chooses to replace that pdf file with another, it can do so easily by browsing, picking another adobe and replacing the existing one.
The I code I use now does that seamlessly with this line of code:
Upload.OverwriteFiles = True
The one I was using before couldn't do that and I had a horrible time trying to modify it to do so.
I finally abandoned it for what I am using now.
So the code I looked at right now will put me through the same pain and time.
This one I can't afford to use up more than one day to get it working again because it is disrupting their work as we speak.
 
thanks for all the help.
If you find any aspSimpleUpload version of 'Upload.SetMaxSize', please let me know.
I have looked through the documentation tha came with what you sent but couldn't find anything.
I will look on the web for further help.
 
SetMaxSize is not supported. Why do you think 2 different DLL's are compatible?
Obviously you want to limit the file size. There's a free component for that too: ImageSize from Serverobjects.
[yes: you can do that too with javascript, but i'm a server-based-computing guy].
With the filesystem object you can handle all issues regarding deleting files etc.


hth,
Foxbox
ttmug.gif
 
Nope, I didn't say that they are comparable.
What I said was that there is usually a different version of a product that does exactly the same thing as another version.
Only difference is that they are done differently.
Example would be:
If I want to write data to the screen, with ASP I say:
response.write; with javaScript, I will say document.write.
You can see that document.write is javaScript's own version of asp's response.write - they both write to the screen.
So I was thinking that with aspUpload, you use upload.setMaxsize; therefore with aspSimpleUpload there is got to be a syntax that does exactly what upload.setMaxsize does.
However, I must say that I am not really concerned about upload,setmaxsize.
I am more interested in a syntax that allows me to overwrite an existing file with a new file.
with something like:
Upload.OverwriteFiles = True
 
TheWebDataGuy,
I am basically turning to you now for help.
I am looking into aspSmartUpload and I was wondering if it has a feature that allows one to modify existing records.
The way it currently works with aspUpload is you use Upload.OverwriteFiles = True.
This way, I can select another file over an existing file.
Is there any such feature with aspSmartUpload component?
 
Sure, if I am gathering it right form your messages, it can do all you want. Here is a few sample for each functions you mentioned:

Maximum allowed size of one file to be uploaded:

<%
MyUpLoad.MaxFileSize = 100000
Response.Write(&quot;MaxFileSize=&quot; & MyUpLoad.MaxFileSize & &quot;<br>&quot;)
%>

Contains the upload denied file extensions list:

<%
MyUpLoad.DeniedFilesList = &quot;bat,exe,com,asp&quot;
Response.Write(&quot;Files denied=&quot; & MyUpLoad.DeniedFilesList & &quot;<br>&quot;)
%>

For overwriting files, you can use this Methd:
Save the file on the disk. Always overwrites existing files
<%
myUpload.files.item(2).saveas &quot;c:\temp\&quot; & myUpload.files.item(2).filename
myUpload.files.item(3).saveas &quot;/docs/&quot; & myUpload.files.item(3).filename
myUpload.files.item(4).saveas &quot;myFile.txt&quot;
%>

I did a lot of file transfer, back and forth with this little component. If you use it under IIS6, you need to do some modifications in the Registry to make it cooperative with larger files, but other than that it works like a charm.

I hope this can help...

Ayac
 
Thanks Ayac for your response.
Can you please explain this part to me:

<%
myUpload.files.item(2).saveas &quot;c:\temp\&quot; & myUpload.files.item(2).filename
myUpload.files.item(3).saveas &quot;/docs/&quot; & myUpload.files.item(3).filename
myUpload.files.item(4).saveas &quot;myFile.txt&quot;
%>

I see item(2).saveas then I see item(2).filename.
Please explain to me how this works as far as overwriting an existing file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top