Solved

Simple file upload form

Posted on 2001-08-16
27
333 Views
Last Modified: 2013-12-24
I'm looking for an example page that only contains a form from which the user can upload a file to my web site.  I'm trying to give my customers the ability to send me files in the most user friendly way available.  I'm kinda picky, but it pays well.  If you have any other questions, let me know...  I'll be around often.
0
Comment
Question by:Smokintbird
  • 14
  • 13
27 Comments
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6394974
Not only do you need the form, you need a way to tell the server where to save it.  I use ASPUpload for this.  
Here's an example.

<%
If Request.QueryString("action") = "upload" Then
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.Save ("path to your folder\foldername")
%>
     <center>
     <h4>File was successfully uploaded!</h4>    
<%          
End If
%>

<form name="frmUpload" enctype="multipart/form-data" method="POST" action="WPupload.asp?action=upload">
   <h1 align="center"><b><font color="#CC9900">Select a file to upload:&nbsp;</font></b></h1>
  <p align="center">
       <input type="file" name="upload" size="38"></p>
  <p align="center"><input type="submit" value="Upload Now!"></p>
</form>



If you cannot use ASP let me know...I'll try to find you another option.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6395124
Well, I don't know jack about "asp" except that it's a web component.  I'm a Visual Basic programmer, with some decent experience with javascript, dreamweaver and front page 2000, but I'm not sure what you're talking about.  My web host supports front page server extensions, but I'm not sure of much more that that.  The provider is "www.atfreeweb.com", I hope that helps...  
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6395159
Well, the good new is you are on a windows server.....but they don't explicitly say that ASP is available...except in the premium plan.

Make a page call test.asp and try this as the code:
<%
response.write "This is a test"
%>

If the words This is a test are written when you call up the page then you can use asp.  However...they haven't completed the page where they tell you how to upload on to your server.  http://www.atfreeweb.com/resources/ASP.htm

I would suggest sending them an email asking what upload component they support.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6395192
ok...   that worked just fine when I typed it in by hand, so it aparently supports ASP...   now what?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6395326
From Above:

>>I would suggest sending them an email asking what upload component they support.
*********************
As a starter....your form needs to contain
<input type="file" name="upload" size="38">

But how you tell the server what to do with it depends on the components they have installed.

Pop off a quick email and see what they say.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6395330
Try the script I orignally posted.  ASPUpload is one of the more popular components they could be using.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6396649
I've got an email in to them, and I'm waiting for a response, so I've not forgotten you, just waiting for their awnser.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6396738
Great!  When you find out, we can continue....not much point otherwise...it would be "reinventing the wheel".
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6411528
I'm begining to have doubts about my web site host...
anyway, after unawnsered emails, I finally called them.  they said that they support all of the components that come with windows 2000 server, with the service pack 2.  they also said that they knew that they supported the "file system object".  I personally have no clue what they are talking about, but was hoping that you would.  They also promised that I would recieve a reply to my emails, by someone who knew more about what I was asking.  So...   hopefully I will be able to provide you with more information if you need it.   what do you think?  does this tell you anything usefull, or do we continue to wait?
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6411532
Oh yea...  they also said that if you had a URL to where they could find information about the component and maybe where to download it, they would "consider" whether they would put it on my server.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6411840
I finally recieved an email from them, and it reads:

We commonly suggest our users use FileSystem Object and asp codes to
make the upload function.
If you want us to set any free component on the server for you, please
give us the related URL. We will evaluate it first and install it for
you.

Thank you for using AtFreeWeb.com.

0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6413039
I also set the visitor write permission to a folder in my web named "upload".  I think we've got everything we need to continue, let me know what you think.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6413050
Here's a cgi form that will do the trick for you....

http://www.terminalp.com/cgi-bin/dc.pl?url=/uploadtest.html

And here is a JavaScript alternative...

http://javascript.internet.com/forms/upload-filter.html

But the one I like to use (as outlined above) is ASPUpload.

http://www.aspupload.com
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:Smokintbird
ID: 6414212
ok...  I see how these exapmles work, but I'm not sure what to do with them to make them work for me.
I've tried the javascript code, and it references a "some-script.cgi" which script do I use and where do I put it?
I've tried using the CGI example, but where do I get the script and what do I do with it? I tried downloading their script, but all I ever get when I try to use it, is "page cannot be displayed".  I tried using the file-upload.cgi from the CGI example, and putting it in a CGI-BIN directory on my web, and using both examples of forms, yet I keep getting the "page cannot be displayed".  
As I said in my original question, I'm not an expert at web programming, but by now, this should be prety clear.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6414637
<Classy gives her head a shake>

You can use ASP...so why are we goofing around with CGI???

First...give the www.aspupload.com link to your server host.  If they don't already have an upload component on
thier site, they should!

Any way....

Here is a great article on how to do it quite easily with ASP.  No components needed other than VB needs to be installed on the server.

http://www.asp101.com/articles/jacob/scriptupload.asp

There is even a link to a zip file that not only has the script, but a working example and a readme file.

http://www.asp101.com/articles/jacob/fileuploader.zip
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6453205
smokin.....how's it going?
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6455083
no luck...   either they don't support the method I'm using, or else I just don't know what I'm doing.  The latter is more likely the problem.  I told you to start with, that I didn't know anything about ASP.  You've sent me these links, and I don't understand much of what they are saying.  I've tried their examples, and they work like a champ, but when I try to modify them for my page, they no longer work.  I'm pretty much out of Ideas.  If there is anything else you can contribute, I would appreciate it, because what you've sent me doesn't work.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6455134
Can you show me what you've got, and indicate exactly what errors you are getting?
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6458533
' Check where the user wants to save the file
If Uploader.Form("saveto") = "disk" Then
     
' Save the file
File.SaveToDisk "E:\UploadedFiles\"

This part is giving me problems...
I'm not sure what the pat is.
I've tried "www.mysite.com/upload"
I've tried "(Drive):/users/catkinson2000/upload"
(using C: through J:)

none of these has worked.
Any Ideas?  I'm drawing a blank at this point.
is there anything else I need to change?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6458556
What error message is it giving you?  Do you have Write permissions on the Uploadedfiles directory?
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6459071
it's just giveing me the page cannot be displayed error.

I'm trying to modify the "uploadexmple.asp"...
should I be modifying the "upload.asp"???  
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6459155
ok...   I deleted the files I was trying to use, and started fresh with newly downloaded files.
The only thing I changed was the line in "uploadexple.asp" that said:
File.SaveToDisk "E:\UploadedFiles\"

I changed it to:
File.SaveToDisk "http://www.theatkinsonfamily.org/upload"

It apears to be working, but I'm not finding the files it says are being uploaded.
I set up the "www.theatkinsonfamily.org/upload" folder to allow user upload.

There's got to be something I'm not doing, or not doing right.  
Any Ideas?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6460488
ok...usually you cannot save in this method to an http address.  You will have to figure out the server's actual path to this file.

This is for security reasons.  If you could to it that way, you could upload to any server in the world!

Let's try to get the server to spit out it's address.

Response.Write Server.MapPath("../")

This will get the page to write the actual server address of the directory ABOVE the one this page is in.  Then you will know what to put in your SaveToDisk parameter.  The results may surprise you...many webservers have you lodged in hidden directories you's never guess about!
0
 
LVL 7

Accepted Solution

by:
ClassyLinks earned 300 total points
ID: 6464831
Just as a point of interest:

visit http://mysite.classylinks.ca/_sitepages/pictures and you will see how I've done it as a demo for potential clients.  Mine is set up only to upload pics, but it is the same basic principle.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6465887
FINALLY!!!

It worked.

I appreciate all your help.

Later.
0
 
LVL 1

Author Comment

by:Smokintbird
ID: 6465892
Well worth the points!
enjoy all 1200 expert points...
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6466043
Hurray!  More important that you got it working than the points, but thanks!

Come back any time.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now