Results 1 to 7 of 7

Thread: Browser upload

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    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.

  2. #2
    scoutt
    Guest
    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.

  3. #3
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    don't you need some upload component to actually upload it?

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  4. #4

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    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.

  5. #5
    scoutt
    Guest
    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.

  6. #6
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

  7. #7
    scoutt
    Guest
    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
  •  



Click Here to Expand Forum to Full Width