Image Upload/Delete

This is a discussion on "Image Upload/Delete" within the Classic ASP section. This forum, and the thread "Image Upload/Delete are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 16th, 2003, 17:51
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Image Upload/Delete

Does anyone know of a script/program that will do the following.

I have a products page that has two inputs for images. One image is the full/regular size and the second input is for a thumbnail. I need the image to be uploaded to an image folder and the image name/location recorded in a database. The above I can accomplish with FP Upload component. I would like to go further in being able to view the image from the products page, delete the actual image and db location marker, either with a delete function or when the record is deleted. Something that would resize and image or auto crate a tumbnail would be good but not necessary.

Thanks

Ernest L. Kendricks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 16th, 2003, 20:18
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,193
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
I've always found an image location field in the database to be unnessesary. This is because database tables have Primary Keys.

In your Products table for instance, the primary key will almost certainly be the product_id.

Simply take the product ID and use that as the filename. Have 2 folders (Large and Thumbnail). You know that 45.gif in the thumbnail directory is the thumbnail image for the product who's ID is 45. If it does not exist, then it simply does not have an image associated with the product.

All upload components allow you to save files on the server using whatever filename you wish, and this is a good system,a s it keeps everything regarding a product under it's database ID.

If you were to offer PDF brochures for each product for instance, these could be stored in a 'Brochure' directory. If there is no file in the brochure directory called 45.pdf, then you know product 45 does not have a brochure!!!

Viewing the image from the products page is very simple. The products page will already have to hand the product_ID in order to display product information. A simple call to the filesystem object will reveal if the image associated with the product exists.... if it does, display it... if not, don't (Or use an image to identify no photo exists)

If you are allowed to install third party COM objects on your web server (Not many ISP's allow this on shared hosting plans), then there are plenty of objects out there to resize images and create thumbnails.

Hope this helps!
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 17th, 2003, 12:30
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Rob is correct and here is a free image resize component:

http://www.silberfish.com/sfir/default.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 17th, 2003, 18:33
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the reply and info. Using the Primary key makes sense in identifying what goes with what.

The product page I'm referring to is and admin page used to add, edit and or delete products. This page is not accessible to the public.

My main concern here is being able to delete images from the the image folder without having to do it manually. I would like a function on the products page (admin only) to delete the image or replace the current image with a new one. Also if a product is deleted, the image in the image folder is also deleted, thus preventing orphaned images.

Thanks

Ernest
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 18th, 2003, 10:46
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
do you have the VBScript documentation installed, there is an example of how to delete/move files using the file system object.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 18th, 2003, 12:36
Junior Member
Join Date: Nov 2003
Location: United Kingdom
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
You could have a look at the following functions that someone made. They simplify the FSO object a hell of a lot and let you concentrate on doing what you want to do - move/delete etc

http://www.asp-help.com/articles/filesys_functions.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
image, uploaddelete

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to view an image to the upload directory? lyndon PHP Forum 5 Nov 12th, 2007 04:27
Example of Image Upload hanusoft Classic ASP 1 Sep 20th, 2007 10:39
upload image webdeveloper Classic ASP 0 Aug 3rd, 2007 07:54
Delete Image with PHP Script toneemontana PHP Forum 3 May 4th, 2007 08:32


All times are GMT. The time now is 01:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved