» Host multiple domains in one plan
» Manage all your domains in one control panel
» Both Windows and Linux Options
» Windows Plans starting at .95 per month
» Linux Plans starting at .95 per month
» Windows Plan: MS SQL 2005 Database Included
 
Window Plans   Linux Plans
 
Close  
Accu Web Hosting Accu Web Hosting Accuweb Hosting
Accu Web Hosting Accu Web Hosting Window Hosting Home Accu Web Hosting Window Hosting Accu Web Hosting PHP Hosting Accu Web Hosting Reseller Accu Web Hosting SQL Hosting Accu Web Hosting   accu web hosting
 

Go Back   Web Hosting Technical Support Discussion Forum > Articles for Web Hosting > General Discussions

General Discussions General discussions regarding articles for web hosting.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 06-22-2006
Senior Member
 
Join Date: May 2005
Location: (.)
Age: 25
Posts: 144
Rep Power: 0
Manuel_ is on a distinguished road
Send a message via MSN to Manuel_
Default

Hello,

1 <%
2 Option Explicit
3
4 Dim upl, NewFileName
5
6 Set upl = Server.CreateObject("ASPSimpleUpload.Upload")
7
8 If Len(upl.Form("File1")) > 0 Then
9 NewFileName = "/Uploads/" & upl.ExtractFileName(upl.Form("File1"))
10 If upl.SaveToWeb("File1", NewFileName) Then
11 Response.Write("File successfully written to disk.")
12 Else
13 Response.Write("There was an error saving the file to disk.")
14 End If
15 End If
16 %>
17
18 <html><head><title>ASP Simple Upload Example #1</title></head></title>
19 <body>
20 <form method="POST" action="Example1.Asp" enctype="multipart/form-data">

21 Select a file to upload: <input type="file" name="File1" size="30">
22 <input type="submit" name="submit" value="Upload Now">
23 </form>
24 </body>
25 </html>



Line # Description

--------------------------------------------------------------------------------

1 Starts the ASP code section of the file.
2 Forces us to declare all of our variables.
4 Declares the variables that we're going to use in the code.
6 Create an instance of the Upload component so we can use it throughout the code.
8 Check to see if the user uploaded a file. If they did, this will contain the name of the file on their hard drive. Also, note that we us the component to get the form fields, not the Request object. You must use the component to read the form variables in all of the forms with file uploads on them.
9 Set the NewFileName variable to the /Uploads/ directory in our web server root and append just the name of the file that was uploaded.
10 Save the file to the our web server. This method automatically calls the Server.MapPath for you so you don't have to figure out where your website is physically located. The first parameter of SaveToWeb is the field name (File1) and the second parameter is the location and filename you want to save this file to.
11 If the save was successful, we tell the user.
13 Otherwise, tell them the upload failed.
16 End the ASP part of the page.
20 Start our form making sure to set the method to POST and the enctype to multipart/form-data.

21 Add the file input tag to the form with the type of file and the form field name of File1 and a form field length (on the screen) of 30.
22 Add the submit button to the form so that after they select a file to upload they can submit it to this page for processing.
23 End the form
__________________
Strat with Linux || Optimize, Secure and increase performance of Apache || Already Started
The visionary conceives the impossible, The missionary makes it possible. ...Gita.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 change the ASP Upload limit Vaughn TroubleShooting 1 06-30-2006 06:58 AM
upload the dump file from PHPMyAdmin Manuel_ Control Panel Discussion Forum and Support - CPANEL - HELM 0 06-25-2006 11:07 AM
2 Simple banners that could pay your web bills kgippc Web Master Related Offers 0 04-06-2006 11:15 AM
how to upload webapplication to internet jency Windows Web Hosting Discussion Forum 1 06-01-2005 08:21 AM
How to upload images through ftp rana TroubleShooting 0 05-31-2005 06:25 AM


All times are GMT -5. The time now is 12:05 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC5
http://www.accuwebhosting.com/terms.htm

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32