1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

File Uploading

Discussion in 'Programming' started by ResaleBroker, Jul 12, 2004.

  1. #1
    I would like to allow clients to upload digital photos [files] of their home so that I can place them on my website.
    SEMrush
    On many sites there is a "file upload" function with a browse feature that allows you to look for files on your local computer.

    What is involved in setting this up?
     
    ResaleBroker, Jul 12, 2004 IP
    SEMrush
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,288
    Likes Received:
    2,600
    Best Answers:
    460
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    What server-side scripting languages are available on the server? PHP, ASP, etc.?
     
    digitalpoint, Jul 12, 2004 IP
  3. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    TwisterMc, Jul 12, 2004 IP
  4. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #4
    I'm on a Linux server and the only available server-side scripting language are PHP, CGI, and Pearl.
     
    ResaleBroker, Jul 12, 2004 IP
  5. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #5
    WOW! :eek: You wouldn't happen to know of a "For Dummies" paper on that would you?
     
    ResaleBroker, Jul 12, 2004 IP
  6. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #6
    ResaleBroker, Jul 12, 2004 IP
  7. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok this is what i do in my php file....

    $name = $_FILES['uploadfilename']['name'];

    if (is_uploaded_file($_FILES['uploadfilename']['tmp_name'])) {
    copy ($_FILES['uploadfilename']['tmp_name'], "www/upload/files/".$_FILES['uploadfilename']['name']);

    Note: In my form my file field has a name of uploadfilename

    Does that help any?
     
    TwisterMc, Jul 13, 2004 IP
  8. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #8
    Please look at the sequence below and tell me what steps are missing.

    1.) I created a form:

    <form enctype="multipart/form-data" action="http://www.resalebroker.com/uploadfilename.php" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
    </form>

    2.) I created a PHP file named "uploadfilename.php"

    Contents:

    $name = $_FILES['uploadfilename']['name'];

    if (is_uploaded_file($_FILES['uploadfilename']['tmp_name'])) {
    copy ($_FILES['uploadfilename']['tmp_name'], "www/upload/files/".$_FILES['uploadfilename']['name']);

    I appreciate the help. :)
     
    ResaleBroker, Jul 13, 2004 IP
  9. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #9
    First off, your if statement needs to be closed with a } ;)

    Second, in the php file you need to change uploadfilename to userfile as your field name is different than mine was.

    Are you getting errors? Do you have a site up we could see? I always helps :)
     
    TwisterMc, Jul 13, 2004 IP
  10. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #10
    Sorry it took so long to get back. I finally figured it out. Thanks for the support.
     
    ResaleBroker, Aug 4, 2004 IP