Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    2
    Thanked 0 Times in 0 Posts

    godaddy gdform.php file upload extra code required

    hi...first, i'm a complete dunce! and new to making websites.
    i have a form on my website hosted on godaddy that i have managed to get working just fine using the gdform.php

    however i want to be able to receive attachments/files from the form. i put the form together but i only received the text input, no files.

    i contacted godaddy and they said the gdform.php doesn't handle file uploads and that i need more code to enable this function on my form, and they suggested i browse the internet to find help...i know, great customer support!

    so that's why i'm here, has anyone run into this before, how do i find the code i need to allow a user to upload a file to me from my site?
    any help would be much appreciated!!!
    all the best
    david

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    godaddy is a hosting service, and are not really obligated to provide you with program code, so I don't think that they are providing you poor customer service
    As for uploading, you need to simply create a form, that must be of a post method, encoded with multipart/form-data (someone correct me if this is wrong, I'm writing this on the fly and am too lazy to double check it :P). So like so:
    Code:
    <form name="myFrm" id="myFrm" method="post" enctype="multipart/form-data" action="uploadFile.php">
      <label for="uploadFile">Upload a file</label>
      <input type="file" name="uploadFile" id="uploadFile" />
      <input type="submit" value="Upload" />
    </form>
    Form file submissions can be retrieved from the _FILES superglobal:
    PHP Code:
    <?php
      $uploadFile 
    $_FILES['uploadFile']['tmp_name'];
      ...
    ?>
    Check on the php site, http://ca3.php.net/manual/en/features.file-upload.php for information about what is stored in the _FILES hash.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    abigscot (01-13-2008)

  • #3
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Just a slight word of caution...you're not going to want to allow just anybody to be able to upload files to your site b/c some malicious people may upload something to take over your complete site. So if, you aren't requiring a log in for users or something I'd suggest not allowing random people the privilege of uploading.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • Users who have thanked StupidRalph for this post:

    abigscot (01-13-2008)

  • #4
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Go-daddy allows you to create password protected directories, i would suggest creating one and putting the file uploader there. Then only you have access to it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •