Signup · Login
Stardeveloper.com  
Home · Articles · Forums · Advertise · Contact
Article Categories
.NET  .NET
  ASP (15)
  ASP.NET (26)
  ADO (16)
  ADO.NET (10)
  COM (6)
  Web Services (4)
  C# (1)
  VB.NET (3)
  IIS (2)

J2EE  J2EE
  JSP (15)
  Servlets (9)
  Web Services (1)
  EJB (4)
  JDBC (4)
  E-Commerce (1)
  J2ME (1)
  Products (1)
  Applets (1)
  Patterns (1)
Latest Forum Activity
Re: viewing my asp pages from a different bro..
by crabpot8 Today Go To Post

Re: viewing my asp pages from a different bro..
by ddebidin on 9 May 2008 Go To Post

Re: Newbie in ASP Please help
by ddebidin on 9 May 2008 Go To Post

Re: ASP Newsletter
by ddebidin on 9 May 2008 Go To Post

Check uploaded file filesize.
by Sammy2008 on 21 Apr 2008 Go To Post

Log In
UserName Or Email:

Password:

Auto-Login:

Miscellaneous Links
  Submit Article

Hosted by Securewebs.com
 
Home : .NET : ASP : Uploading Files to the Server Hard Disk using plain ASP
 

Uploading Files to the Server Hard Disk using plain ASP
by Faisal Khan.

Overview
This article is number three in a series of articles I wrote about uploading and displaying binary data with ASP. The first article was about Uploading binary data to the database, second was on Displaying binary data from the database and the third one ( this one ) is going to be on 'Uploading files to the server hard disk using pure ASP'.

File Uploading with ASP.NET
If you have the privilege of using ASP.NET then you should read these comprehensive tutorials regarding file uploading using built-in ASP.NET server controls:

  1. File uploading to server hard disk.
  2. File uploading to Microsoft Access database.
  3. Uploading images, determining size, width & height and resizing image files.

I'll assume that you have read the previous articles and thus will only concentrate on the parts which are new in this article. I get enormous amounts of emails by people asking me how to upload files with ASP. This article is going to be an answer to all those questions.

In all the previous articles we have been using Loader.asp to handle binary data. Same is going to be the case in this article. We'll though modify Loader.asp a bit to allow us to save uploaded binary data to the server hard disk.

Loader.asp
Open your note pad ( or any other ASP editor you use ) and create a new file. Save it as 'Loader.asp'. Now copy the text listed below and paste it in to the newly created 'Loader.asp' page and hit the save button :


 ( 3 Remaining ) Next

Comments/Questions ( Threads: 139, Comments: 319 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

  1. asp uploading files
  2. "Library not Registered" error... and now what? ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  3. error while uploading multiple select drop down values in loader.asp
  4. ok, i uploaded my file. Now, how do i delete it? ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  5. Type mismatch: 'Request.BinaryRead' ( 1 Reply )
  6. Line 70/Blank File Problem Fixed
  7. not able to upload large pic then 200 kb
  8. form validation
  9. Trying to use with SQL Server 2000 ( 1 Reply )
  10. Uploading a file with korean filename.
  11. Hi Faisal, Thanks for the great scripts. One question please. ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  12. e-mail notification when data submitted
  13. Clients being asked to logon to web server
  14. saving file to disk and other fields to access database
  15. how can I place the files in a folder somewhere else on server
  16. download files from another website to my web space
  17. Can't upload file to from a corporate environment
  18. Can not upload files over 150KB - Help ( 1 Reply )
  19. hard code file location
  20. How to use show files page, if we have subfolders in a folder ( 1 Reply )
  21. problem on show.asp page. ( 2 Replies )
  22. Server.MapPath(), ASP 0171 (0x80004005)
  23. Server.MapPath(), ASP 0171 (0x80004005)
  24. Server.MapPath(), ASP 0171 (0x80004005)
  25. Error Type: Microsoft VBScript runtime (0x800A01C9) ( 3 Replies )
  26. Problem with Upload ( 1 Reply )
  27. File uploading to server hard disk w/JavaScript
  28. Won't overwrite existing files. ( 1 Reply )
  29. Adding to database without uploading a file
  30. Storing the file in client system when user exports file in server
  31. uploading large files is getting failed..pls help... ( 1 Reply )
  32. Please help me to resolve error /test/Loader.asp, line 68 ( 1 Reply )
  33. how to convert a binary data to a sound format(.wav) ( 1 Reply )
  34. I have a problem with File Uploading
  35. !!!!HELP!!!!Error in Uploading and Viewing images from database.!!!!!!
  36. Uploading the file into another computer instead of my local drive?
  37. Updating files in DB
  38. Creating Folders From a List
  39. ReUse the
  40. How to create multiple folders from a list (either XLS or pure text)
  41. How to upload a zip file into data base
  42. Microsoft VBScript compilation error '800a0401'
  43. Need Help Immediately ( 1 Reply )
  44. SQL server
  45. File size error & cannot opened...urgently need HELP....any ASP Expert~?!! This gonna wreck me out!! ( 3 Replies )
  46. Progress bar
  47. fast web view
  48. Problem using Loader.asp with listbox ( 4 Replies )
  49. Caution when using Content Type in DB
  50. SaveToFile Permission Error ( 2 Replies )
  51. Get this error when upoading files 200k + ( 2 Replies )
  52. Error HTTP500 Internal Server Error what its means ( 1 Reply )
  53. "Permission Denied!!!" How to use proper UserID/Password with appropriate rights. ( 1 Reply )
  54. Upload File to File server ( 1 Reply )
  55. the one getting saved is insert.asp itself
  56. Uploading to each user's folder ( 1 Reply )
  57. Please Help!!! ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  58. PLEASE HELP - How can I change the location of where I upload the files to? ( 1 Reply )
  59. File Name Always Comes back as File.EXT ( 1 Reply )
  60. Update
  61. i need to specify file type to be loaded ( 3 Replies )
  62. File Not uploading
  63. SQL Display ( 1 Reply )
  64. Problem using Loader.asp with listbox ( 2 Replies )
  65. Updating my image files and text form
  66. File with this name already exists in folder
  67. Upload multiple files ( 3 Replies )
  68. Thanks
  69. Name field on insert.htm
  70. how to grap the files' date in the uploaded dir???
  71. one more field in the form ( 2 Replies )
  72. insert.asp not processing
  73. Error when submitting form
  74. file name ( 1 Reply )
  75. loader initialization
  76. Folder does not exist ( 1 Reply )
  77. How do I go about referencing form elements when using enctype multipart/form-data? ( 2 Replies )
  78. Show the images to the id on the SHOW site !!
  79. Show/viwe others files on the FILE.ASP site !!!
  80. insert.htm is hanging for long time ( 3 Replies )
  81. Thanks Faisal! ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  82. Form Field Array support?
  83. Problems opening files with SQL database ( 2 Replies )
  84. Help wanted...Loader.asp
  85. Microsoft JET Database Engine error '80040e14' ( 1 Reply )
  86. Error when uploading Images to the specific folder ( 1 Reply )
  87. File size limitation using plain ASP
  88. Insert.asp stalls - no upload executed??? ( 2 Replies )
  89. Viewing a specific uploaded file
  90. How to connect to database Access ( 1 Reply )
  91. Sending XML via SFTP
  92. Showing file content ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  93. Correct syntax to use additional form fields in
  94. Error When I submit!! Can anyone help me please!! ( 4 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  95. Showing more fields on Show.asp page
  96. Error while uploading file ( 3 Replies )
  97. Will this function work on a Mac? ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  98. Delete binary Data from database ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  99. uploading more than one file
  100. file not renaming after upload
  101. UTF-8, MSCMS and additional appended characters ( 2 Replies )
  102. How to define the content type of file that can be uploaded?
  103. Path Not Found ( 5 Replies )
  104. putting form values into dictionary
  105. Selecting folder to save file to ( 1 Reply )
  106. Microsoft VBScript compilation error '800a0401'
  107. Doing something similar to this...
  108. Great stuff !! couple little problems tho
  109. SQL version of File Uploading with ASP ? ? ( 2 Replies )
  110. Server object error 'ASP 0177 : 800a0046' ( 6 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  111. Getting error with listbox ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  112. Want to include more uploading fields. Is it possible??? ( 3 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  113. Incorrect File Type and/or corruption in chinese ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  114. How to include a few other form fields? ( 3 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  115. File Path ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  116. Previewing Image from databse ( 5 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.
  117. Getting error while uplaoding files ( 3 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  118. Problem of Upload ( 1 Reply )
  119. Incorrect File Type and/or corruption ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  120. Awsome ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  121. delete files ( 2 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.
  122. VBScript Compilation error ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  123. file validation ( 8 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.
  124. problems with UTF pages ( 4 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.
  125. Permission denied on Win2K pro ( 6 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.
  126. What is the Limit for showing images ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  127. Broken link ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  128. file check ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  129. Prompting User for renaming ( 2 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  130. Rename the file only if it exists ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  131. Problem with uploading ( 9 Replies ) This thread contains 4 replies by the Author of this Article. This thread contains 4 replies by Faisal Khan.
  132. simple code without components ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  133. Problem on File Uploading with ASP ( 8 Replies ) This thread contains 3 replies by the Author of this Article. This thread contains 3 replies by Faisal Khan.
  134. Hats of to you Faisal, but just one more question ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  135. File Resizing ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  136. How to SEARCH Binary content type ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  137. download files show up as file.asp ( 9 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  138. How to support double byte if sending txt file ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  139. File Renaming ( 9 Replies ) This thread contains 3 replies by the Author of this Article. This thread contains 3 replies by Faisal Khan.

Post Comments/Questions

In order to post questions/comments, you must be logged-in. If you are not a member yet, then signup, otherwise login. Once you login then come back to this page and you'll see a form right here which will allow you to post comments/questions.

Please note, one of the benefits of signing up is to be notified immediately by email everytime you receive a reply to the thread you have subscribed.

 
© 1999 - 2008 Stardeveloper.com, All Rights Reserverd.