Important alert: (current site time 7/15/2013 10:42:38 PM EDT)
 

winzip icon

A+ ASP Image/Document uploader | view/delete/upload files... create/delete folders

Email
Submitted on: 2/13/2002 6:00:57 PM
By: Mike Loffland  
Level: Intermediate
User Rating: By 20 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 74369
(About the author)
 
     This script utilizes a mix of server-side ASP and client-side vbscript to provide users with the capability to navigate the directory structure of the web-server, select an image file or a document file, and then pass the file attributes back to an HTML form. If the file selected is an image... The image will be displayed to the user so they know that the selected file is the one they want. In addition... the name, width, height, and size of the selected image is collected (code snippet borrowed from Mike Shaffer on 4guys http://www.4guysfromrolla.com/webtech/050300-1.shtml) and passed back to the HTML form. If the file selected is a document... the user has the option to download and open the selected file. The name and size of the document selected is passed back to the HTML form. Additional functionality: UPLOAD IMAGE OR DOCUMENT FILES to the given directory... DELETE IMAGE OR DOCUMENT FILES in the given directory... CREATE NEW FOLDERS... DELETE FOLDERS. This code can be modified to allow any type of file to be uploaded.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :A+ ASP Image/Document uploader | view/delete/upload files... create/delete folders
'**************************************
Active Server Pages. Client-Side VBScript.
The required "uploader.dll" component is zipped in this zip file. The source-code is included (imageClass.cls).
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/14/2002 11:21:14 AMChris Walker

This code is awsome! I've been looking for something like this for a long time. This will make a lot of the admin editing on my company's web site a lot easier.
(If this comment was disrespectful, please report it.)

 
2/14/2002 11:43:46 AMMike Loffland

The source-code for the uploader.dll is now included in the .zip file (as requested)
(If this comment was disrespectful, please report it.)

 
2/20/2002 2:27:37 PMRay Barbee

Nice... but you should add the capability to create folders and delete files too. I think that would make this even more convenient.
(If this comment was disrespectful, please report it.)

 
2/20/2002 2:57:40 PMAvery Mitchell

Exactly what I was looking for
(If this comment was disrespectful, please report it.)

 
2/21/2002 5:02:11 PMMike Loffland

Ability to create/delete folders and delete files added (as requested)
(If this comment was disrespectful, please report it.)

 
3/11/2002 5:25:39 AMundercodex

Nice piece of work well done
(If this comment was disrespectful, please report it.)

 
3/18/2002 5:35:02 PMRitzsky

Great work but I can't get it to view the files in any of the directories that I create.
(If this comment was disrespectful, please report it.)

 
3/18/2002 8:23:28 PMMike Loffland

Have you edited the i_settings.asp file to reflect the directory structure of your web server?
(If this comment was disrespectful, please report it.)

 
4/3/2002 11:11:20 AMalexis

Hi, I changed all the appropriate settings and registered the dll on my web server. But when I click on the upload file button I get page cannot be displayed even though all nec files are there. Any thoughts? Thanks
(If this comment was disrespectful, please report it.)

 
5/16/2002 1:18:38 AMDelia

Hi,

I need to upload an image file to my server.

i was wundering if is working with PWS server? I only have win 98

I followed your instructions (the settings for the image path I just leave it deafault) and I runed just
upfile.asp
...I can't get it to work.

could you please help me?

(If this comment was disrespectful, please report it.)

 
5/29/2002 12:54:55 PMMike Loffland

I never tested it on Personal Web
Server, so I'm not sure.

The
"start.asp" script is the intitial
start page for the demo. Follow the
instructions on that page to test
it.

Make sure the component has been
registered as well.

Mike
Loffland
mike@motoregg.com

(If this comment was disrespectful, please report it.)

 
5/29/2002 12:58:16 PMMike Loffland

I updated the script to resolve the "page cannot be found error". The problem was that the script was trying to navigate to a predifned folder that did not exist. This folder is defined in the i_settings.asp file. It was originally set to navigate to C:\inetpub\wwwroot\images. I have since changed this default to C:\inetpub\wwwroot. If you continue to receive the "file cannot be found" error, double check your i_settings.asp file to make sure that the folder defined in the strImageRoot variable is indeed a valid location on your server.

Mike Loffland
mike@motoregg.com
http://www.motoregg.com
(If this comment was disrespectful, please report it.)

 
6/27/2002 3:18:55 AMling

will it able to upload big files?
(If this comment was disrespectful, please report it.)

 
7/3/2002 12:00:22 PMMike Loffland

There is a setting in the i_settings.asp file that will allow you to set the maximum file size allowed.
(If this comment was disrespectful, please report it.)

 
8/9/2002 5:59:21 PMnite

nice work
(If this comment was disrespectful, please report it.)

 
8/10/2002 1:35:32 AMSeetharaman.A

Wonderful piece of work. We have been looking for something similar in VB. We will try to convert into VB for use in WYSIWYG editor.

thanks and continue the great work.
(If this comment was disrespectful, please report it.)

 
1/24/2003 1:04:39 AM

hi mike,

great work!!!

i just have one question, i can browse the images that i want to upload on the images upload pages on the left side, the problem is i cannot see it on the right side although i can see the other file info such as size, width, etc.

i also have notice that although i change the location of the physical path in the i_settings.asp, i cannot view and play the files because it is always pointed on the root directory of the host. what asp pages do i still have to edit?

Regards
(If this comment was disrespectful, please report it.)

 
5/2/2003 1:43:53 AMMike Loffland

There is another variable at the bottom
of the script called strServerName. You
have to append any folder(s) you require to the end of this variable.

The default is:

strServerName = ''http://'' & request.servervariables(''SERVER_NAME'') & ''/''

Example Change:

strServerName = ''http://'' & request.servervariables(''SERVER_NAME'') & ''/myrootfolder/''
(If this comment was disrespectful, please report it.)

 
5/23/2003 3:29:29 AM

10x m8
(If this comment was disrespectful, please report it.)

 
6/20/2003 6:30:39 AMkdinuk

hi its a wonderful code but i am getting error while uploading document or image.please help me.
(If this comment was disrespectful, please report it.)

 
10/20/2003 3:47:22 PM

Great piece of work, but lacks the ability to overwrite files. Is there a way to enable this?
(If this comment was disrespectful, please report it.)

 
12/4/2003 11:35:05 PM

That's great job, it works very well. but now I need to upload more 1 file at 1 time, but I can not rebuild to dll after edited the source code because of lack of declaring library reference. So that, the error occurs while build dll: "ScriptingContext" : User defined type not found !

Help me !!
(If this comment was disrespectful, please report it.)

 
3/10/2004 11:06:18 PM

Hi thanks for sharing the code but is it possible to create a folder without
set
(If this comment was disrespectful, please report it.)

 
3/10/2004 11:09:31 PM

Hi thanks for sharing the code but is
it possible to create a folder without
set write permision on internet guess account at parrent folder

(If this comment was disrespectful, please report it.)

 
9/14/2004 6:38:54 AM

Some JPG files will course the page error
VBScript error 'mid' i_img_util.asp line 185
(If this comment was disrespectful, please report it.)

 
9/17/2004 5:21:54 PM

pls tell me how you register the dll file on the server. thanx
(If this comment was disrespectful, please report it.)

 
9/17/2004 5:24:07 PM

Hi there. Just a simple question. How you register the .dll file on the server? thanx
(If this comment was disrespectful, please report it.)

 
12/9/2004 12:11:43 AM

i get this error

Microsoft VBScript runtime error '800a0044'

Device unavailable

i_utility.asp, line 39

(If this comment was disrespectful, please report it.)

 
1/25/2005 7:21:26 PM

I do find the code simple and easy to understand... yet i'm still having a hard time using it... ^^
(If this comment was disrespectful, please report it.)

 
8/25/2005 11:05:45 PMiman

best code
(If this comment was disrespectful, please report it.)

 
7/7/2007 9:41:22 AMMakrand

This is very useful site and giving very help ful code for developers
(If this comment was disrespectful, please report it.)

 
1/8/2009 8:05:01 PMnimish_c_patel

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed

/asp/display.asp, line 247

800401f3

i have register the dll.and done all that stuff that yu describe in install.txt
please do help what can i do.
i dont be able to run program
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.