Skip to main content
juresti
Known Participant
February 25, 2011
Question

Upload File

  • February 25, 2011
  • 1 reply
  • 566 views

I want to be able to upload vidoe files (approx. 10MB) in two folders on two servers. Is this possible? I'd like to upload them and somehow save the filename to use for the url in the link in the table on the page. This is using classic asp.

Is this possible? Any help is appreciated!

This topic has been closed for replies.

1 reply

Participant
March 22, 2011

Hi

Was looking at the forum trying to find something pertaining to my problem and thought this might help you.

The service provider gave me this code for uploading an image for an asp page that works on their servers.

I haven't been able to make it work for my purposes (attaching a photo to an email form in my customer's web site) but if you can figure what to replace/add it might work for your purposes.

<html>

<bodya bgcolor="#FFFFFF">

<h3>Upload an image, and the script will create a thumbnail.</h3>

   <form method="POST" enctype="multipart/form-data" action="tech-support-asp-aspjpeg.asp">

   Select file: <input type="FILE" size="40" name="FILE1"><input type=SUBMIT value="Upload!">

   </form>

<br><br><br>

<%

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

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

' we use memory uploads, so we must limit file size

Upload.SetMaxSize 100000, True

' Save to memory. Path parameter is omitted

Upload.Save

' Build path string

Path = "data/"

' Save files to it. Our form has only one file item but this code is generic.

For Each File in Upload.Files

   File.SaveAsVirtual Path &  File.FileName

   Response.Write "File saved as " & File.Path & "<BR>"

' Compute path to source image

Path = Server.MapPath("data/" & File.FileName )

' Open source image

Jpeg.Open Path

' Decrease image size by 50%

Jpeg.Width = Jpeg.OriginalWidth / 2

Jpeg.Height = Jpeg.OriginalHeight / 2

' create thumbnail and save it to disk

Jpeg.Save Server.MapPath("data/small_" & File.FileName )

   Response.Write "Thumbnail created, and saved as " & "data/small_" & File.FileName & "<BR>"

Next

%>

</body>

</html>

juresti
jurestiAuthor
Known Participant
March 22, 2011

Thank you I will look into it. I've gotten sidetracked and this is not a

priority to management now. But may be again soon. Thanks for the info!