PDA

View Full Version : ASP Pictures to Thumbnails.


Chaps
01-16-2004, 11:19 AM
I have figured out how to get aspupload to work with my site thanks to your forum posts. I'm working on the ability for a user to upload files to a database (I think I have that working). These files are going to contain pictures as well as some form information such as name and description. What I don't know how to do is when they upload pictures to automatically turn those pics into thumbnails?? Any ideas?? Also I know you guys have asupload enabled but do you also have aspjpeg?

Thanks
Chaps

bruce
01-17-2004, 05:57 AM
Aspjpg is not supported

try use aspimage instead.

[b]quote:Originally posted by Chaps

I have figured out how to get aspupload to work with my site thanks to your forum posts. I'm working on the ability for a user to upload files to a database (I think I have that working). These files are going to contain pictures as well as some form information such as name and description. What I don't know how to do is when they upload pictures to automatically turn those pics into thumbnails?? Any ideas?? Also I know you guys have asupload enabled but do you also have aspjpeg?

Thanks
Chaps
</blockquote id="quote"></font id="quote">

Chaps
01-18-2004, 02:25 AM
Okay thanks I'm working on that script now. I must mention I'm VERY new to asp. I want to be able to pass the file name the user uploads to a variable to be used to create the thumbnail file with something like t_%filename%.jpg but I can't seem to figure out how to get the name of the file the user is uploading. Here are my scripts I have for uploading any help would be most appreciated.

layoutup.asp

<html>
<head>
</head>
[b]
<form action="aspupload.asp" method="post" enctype="multipart/form-data">
<input type="file" size="40" name="FILE1" />
[b]
<input type="submit" value="Upload!" />
</form>
</body>
</html>

Aspupload.asp

<HTML>
[b]
<%

Set Upload = Server.CreateObject("Persits.Upload")

' Do not overwrite files if they exist
Upload.OverwriteFiles = False

' Limit file size to 50000 bytes, throw an exception if file is larger
Upload.SetMaxSize 50000, True

' Intercept all exceptions to display user-friendly error
On Error Resume Next

count = upload.savevirtual ("/aspupload/uploaded")
'Response.Write Count & " file(s) uploaded"

' 8 is the number of "File too large" exception
If Err.Number = 8 Then
Response.Write "Your file is too large. Please try again."
Else
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
Else
' Response.Write "Success!"
End If
End If

'Only allow .Jpg files to be uploaded.
For Each File in Upload.Files
Ext = UCase(Right(File.Path, 3))
' If Ext <> "JPG" and Ext <> "DOC" Then
If Ext <> "JPG" Then
Response.Write "The File is of an invalid type. Valid types are .jpg only"
File.Delete
Else
' Response.Write(Request.Form("FILE1"))
Response.Write "Success!"
End If

Next

%>
</BODY>
</HTML>

Thanks

Chaps

bruce
01-21-2004, 03:26 AM
have you look into file system object (FSO)?


[b]quote:Originally posted by Chaps

File.Filename in persists upload gives me the file name that is being uploaded. Also I have gotten aspimage to work in creating thumbnails and I have placed the path as link as well as file name and thumbnail name into a database. All of this works when the user uploads the files automagically. Now I just need to pull the path, thumbnail name, and title of the image and display that to the clients browser as a picture with the title as text any idea on how to do that?
</blockquote id="quote"></font id="quote">

Chaps
01-21-2004, 11:30 AM
File.Filename in persists upload gives me the file name that is being uploaded. Also I have gotten aspimage to work in creating thumbnails and I have placed the path as link as well as file name and thumbnail name into a database. All of this works when the user uploads the files automagically. Now I just need to pull the path, thumbnail name, and title of the image and display that to the clients browser as a picture with the title as text any idea on how to do that?

Chaps
01-22-2004, 08:31 AM
Thanks I have a friend that knows this stuff and does it for a living he is going to help me. Thanks again.