Solved

Simple file upload form

Posted on 2001-08-16
27
330 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Author Comment

by:Smokintbird
Comment Utility
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
Comment Utility
<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
Comment Utility
smokin.....how's it going?
0
 
LVL 1

Author Comment

by:Smokintbird
Comment Utility
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
Comment Utility
Can you show me what you've got, and indicate exactly what errors you are getting?
0
 
LVL 1

Author Comment

by:Smokintbird
Comment Utility
' 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
Comment Utility
What error message is it giving you?  Do you have Write permissions on the Uploadedfiles directory?
0
 
LVL 1

Author Comment

by:Smokintbird
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
FINALLY!!!

It worked.

I appreciate all your help.

Later.
0
 
LVL 1

Author Comment

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

Expert Comment

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

Come back any time.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now