Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2009
    Location
    LDN & The South
    Posts
    147
    Tokens
    0

    Default Need Upload Script

    For file upload websites. Preferably in flash.

    I've tried everything I can get my hands on and nothing will work.


    Any links appreciated!

  2. #2
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    A 'thanks' or a 'please' would be nice, but hey!

    Here's a simple php one...

    PHP Code:
    <?php
    $target 
    "upload/";
    $target $target basename$_FILES['uploaded']['name']) ;
    $ok=1;

    if (
    $uploaded_size 350000)
    {
    echo 
    "Your file is too large.<br>";
    $ok=0;
    }

    if (
    $uploaded_type =="text/php")
    {
    echo 
    "No PHP files<br>";
    $ok=0;
    }

    if (
    $ok==0)
    {
    Echo 
    "Sorry your file was not uploaded";
    }

    else
    {
    if(
    move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
    {
    echo 
    "The file "basename$_FILES['uploadedfile']['name']). " has been uploaded";
    }
    else
    {
    echo 
    "Sorry, there was a problem uploading your file.";
    }
    }
    ?>
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  3. #3
    Join Date
    Jan 2009
    Location
    LDN & The South
    Posts
    147
    Tokens
    0

    Default

    Thanks and appreciation are pretty much the same thing.

    But thanks as well!

  4. #4
    Join Date
    Jan 2009
    Location
    LDN & The South
    Posts
    147
    Tokens
    0

    Default

    Also,

    Is this the script to embed the upload, or the server php script?

    And is the upload limit in Bytes or Kbs?

    Edited by Xarea (Forum Moderator): Please do not double post - thanks .
    Last edited by Xarea; 10-05-2009 at 09:53 PM.

  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    In bytes. Its the processing part which will allow anyone to upload anything to your site.

    Could be a bit neater, but I guess it does the job.
    Hi, names James. I am a web developer.

  6. #6
    Join Date
    Jan 2009
    Location
    LDN & The South
    Posts
    147
    Tokens
    0

    Default

    And how safe is this?

    If i disallow .exe files for upload will it be fine?
    Can i use this script with a flash uploader embedded into the site?

    Thanks

  7. #7
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Yeah of course you will be fine, nothing can be more dangerous than a .exe file on your server!

    If you want a flash uploader, you've got to see what class it uses to upload, say filereference like mine does, the data you'd grab be $_FILES[ 'filedata' ].
    Hi, names James. I am a web developer.

  8. #8
    Join Date
    Jan 2009
    Location
    LDN & The South
    Posts
    147
    Tokens
    0

    Default

    Wheres the best place to find a basic flash uploader? The one'es i found came out on my site as a giant blue square

Posting Permissions

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