|
-
Dec 13th, 2001, 07:36 PM
#1
Thread Starter
Member
Browser upload
If you maintain a remotely-hosted site like on Geocities, Liquid2K, etc. you know that there is usually a text box with a Browse button next to it for uploading files. How could I do that for my site? I've got Apache.
-
Dec 13th, 2001, 08:11 PM
#2
very easy and it will work on any server
<input type="file" value="your_value">
that will show a browse button and a text box so you can upload. beware though there are some problems on sending that file and other variables at the same time. I heard this but never experienced it.
-
Dec 13th, 2001, 08:13 PM
#3
PowerPoster
don't you need some upload component to actually upload it?
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Dec 13th, 2001, 08:15 PM
#4
Thread Starter
Member
That's what I was thinking; I know that the actual HTML is easy but I don't know how to specify the directory and other stuff.
-
Dec 13th, 2001, 08:42 PM
#5
it should upload it to that directory where the html page is in. other than that you will need serverside code to put it in another directory.
-
Dec 14th, 2001, 07:38 AM
#6
Black Cat
You need to set the enctype correctly on the form for the browser to properly upload it:
Code:
<form action="addnew.plx" method="post" enctype="multipart/form-data">
The script you post the form to can read the file data in from standard input. I think the Perl module CGI-Lite's source code might be a good example of how that is done, but why reinvent the wheel when most common server-side scripting technologies have a module or component you can use.
Here's a Perl example:
http://www.oreilly.com/openbook/cgi/appd_01.html
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Dec 14th, 2001, 10:59 AM
#7
thanks josh, I always seeme to forget the enctype. heh e must be getting old.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|