Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Search Stardeveloper.com
Newsletter
Enter your email address to receive full length articles at Stardeveloper:


Article Categories
.NET  .NET
  ASP (16)
  ASP.NET (41)
  ADO (16)
  ADO.NET (11)
  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)
Log In
UserName Or Email:

Password:

Auto-Login:

Miscellaneous Links
  Submit Article
Stardeveloper RSS Feed
Hosted by Securewebs.com
 
Home : .NET : ASP : Uploading Files to the Server Hard Disk using plain ASP
 
RSS - Read full length articles at Stardeveloper using Stardeveloper RSS Feed RSS

Uploading Files to the Server Hard Disk using plain ASP

by Faisal Khan. Follow Faisal Khan on Twitter Follow Faisal Khan on Facebook

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: 141, Comments: 321 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

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