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
what is the right code to link the asp page t..
by amylisa on 22 Jul 2008 Go To Post

Can Loader.asp Get Form Elements
by azziham on 14 Jul 2008 Go To Post

Good asp resource sites
by codemylife on 3 Jul 2008 Go To Post

Re: Unable to insert data in an Access databa..
by asia on 3 Jul 2008 Go To Post

Re: problem with do while loop
by idsanjeev on 30 Jun 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: 140, Comments: 320 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

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