ASP Pictures to Thumbnails.

Discussion in 'Classic ASP' started by Chaps, Jan 16, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Aspjpg is not supported

    try use aspimage instead.

    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">
     
  3. 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>

    <form action="aspupload.asp" method="post" enctype="multipart/form-data">
    <input type="file" size="40" name="FILE1" />

    <input type="submit" value="Upload!" />
    </form>
    </body>
    </html>

    Aspupload.asp

    <HTML>

    <%

    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
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    have you look into file system object (FSO)?


    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">
     
  5. 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?
     
  6. Thanks I have a friend that knows this stuff and does it for a living he is going to help me. Thanks again.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page