Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Wednesday, May 19, 2004 4:54:00 AM(UTC)

Rank: Member

Groups: Member
Joined: 2/12/2004(UTC)
Posts: 24

Was thanked: 1 time(s) in 1 post(s)
I've got my imageuploader working perfectly in my web page. The files save just fine and I've got a vbscript/asp script that keeps track of all my photos by adding a record in an access database for each photo (keeps track of the filename I saved it as, the person/user who uploaded the photo, etc).

Here's my question:

Is there a parameter I can set with image uploader that will pass on to the underlying asp script the ORIGINAL filename of the photo so I can save this as well in my database. The original filename being the name of the file on the user's local machine.

The reason I ask is that I want to test to see if people that use the website are uploading duplicates. If the original filename matches on two photos by the same person, I want to write a script that will give me a warning so I know that two photos are likely the same.

Why this has become a problem:

Our web site is for real estate management. We get real estate agents to upload photos of properties. Some of them upload a lot (50 or so) at a time. Many of these users are on slower connections and some of these photos can get rather large. When user with a slower connection clicks the UPLOAD button to send all these photos, the window will pop up with the blue status bar, when the status bar has hit 100%... they still have to wait a minute ot so for the "UPLOAD COMPLETE" window to pop up. These users aren't too bright. They're assuming that since the status bar has hit 100% that everything is done and they end up closing this status window before the "UPLOAD COMPLETE" window pops up. The result is that if a person is uploading 50 photos, 20 or 30 of them upload properly but the rest don't because the user accidentally cancelled in the middle of the process. They get irritated because the script doesn't finish so then they assume that NONE of the photos uploaded (even though some of them did). They then upload the 50 photos again and end up with duplicates.

This above paragraph isn't your guys' problem... It's a GUI thing that I need to figure out on my own. I just thought I'd let you know FYI for future development. I'd still like to know if we can capture the client-side filename however.

#2 Posted : Wednesday, May 19, 2004 12:55:00 PM(UTC)

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello Brian,

First of all, I would recommend you to upgrade your Image Uploader to version 2.1 which is much more better (see changes list). In particular using this version you could resolve the problem with users who cancels upload earlier than it is necessary (in this case 49 of 50 files will be uploaded successfully).

As for your question regarding file name, Image Uploader (both your version and new one) sends file in the same way as if you upload it through the <input type="file"> tag. It means that you can extract file name in the same way.

As far as I remember your application is written on classic ASP. What upload component do you use to handle uploaded files? As usual all such components returns uploaded files as collection of objects of type File, which has property FileName or Name (it depends on the component), so that your code will be looking like that:

For I=1 To intFileCount
   Set objFile = objUpload("Image" & I)
   objFile.SaveAs(Server.MapPath("Gallery/" & objFile.FileName))

If FileName (or its analogue) contains full path on client computer, you should split file name from the folders. So you should refer the documentation of the component you use for details.

By the way, code samples for Image Uploader 2.1 demonstrates how to save files with their original names (instead of numbers). You can download them and take a look.

02/14/2008, Fedor
This topic is out of date.

We have changed in version 2.x the POST field names. See POST Field Reference for more info.

For example you should SourceFile_N field name instead of ImageN:

For I=1 To intFileCount
   Set objFile = objUpload("SourceFile_" & I)
   objFile.SaveAs(Server.MapPath("Gallery/" & objFile.FileName))


Edited by user Wednesday, October 29, 2008 3:02:15 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.