Welcome to TalkGraphics.com
Results 1 to 3 of 3

Thread: Upload Form

  1. #1
    Join Date
    May 2010
    Posts
    1

    Default Upload Form

    I want to create a form that i can put on my website that will allow users to upload there own files (I want them to only be swf files)

    I have seen a view scripts on how to do this but it never seems to work. I want to know how to do this using the HTML placeholder feature and also i want the files to be uploaded to my web server and i am not sure what permissions i need the upload folder to have

    Cheers

    Campbell

  2. #2

    Default Re: Upload Form

    Welcome to the Forums.

    This isn't strictly a Xara Technical Support or Web Designer/Xtreme software related question.

    Allowing user access to your sever via scripts is a specialised thing, such scripts you can find on-line through searches, or have a web programmer create one for you.

    However, one that comes to mind can be found here:
    Uploader v6

  3. #3
    Join Date
    Aug 2008
    Location
    Canton, GA
    Posts
    666

    Default Re: Upload Form

    Uploads ARE a little wierd, especially if you aren't used to php script. It works in a c-like way in some ways and like pascal if you remember that in some as well.

    In this case, the upload happens as a course of the input field of the HTML form that would be in the placeholder. For example, here's the bit of code in one of my upload forms:

    Code:
    <form id="subForm" enctype="multipart/form-data" action="upload.php" method="post">
    
    	<p><label for="uploaded" class="label">Browse for a media file:</label>
          <input type="file" name="uploaded" id="uploaded" /></p>
    </form>
    Then, in the upload.php, I have this part:

    Code:
    <?php
    $mediafile = $_POST['uploaded'] ;
    
    /* Set the name of the file based on what was  in the form */
    
    $target = "../../media/"; 
    $target = $target . basename( $_FILES['uploaded']['name']) ; 
    
    /* Determine if it worked or not (which actually does the upload and looks for an error */
    
    if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
    { 
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; 
    } 
    else 
    { 
    echo "The file ". $target. " has NOT been uploaded"; 
    }
    In this case, I've taken apart a script that works, so I don't know that this is everything, but it should get you pointed in the right direction. I found and deciphered this via a Google search.

    Hope this helps. If it's completely Greek to you, you might need to hire someone because if it doesn't work at first attempt, without knowledge of the scripts, you will be frustrated trying to get it to work right.

    Also, php has some limitations for file size by defaut, so when you are testing, use small text files or something...these can be fixed in the php.ini if you have access to it on your hosting account. And...there's no progress meter here, so you just have to wait for it to finish - give good page forwards or messages in the if/else to make sure the user knows what happened or didn't.
    Last edited by slavelle; 17 May 2010 at 01:50 PM. Reason: fixed code

 

 

Bookmarks

Posting Permissions

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