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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with file uploading

    I want to make a video uploader interface for the visitors of my site so they can upload videos to the server. The problem is that I'm not good at PHP and no tutorials proved much use to me. So I'm asking you PHP pros if you could write the whole code ofr me please? I would be very grateful to you.

    Heres the information which you may require to write the correct code for me:

    *The address of my site is www.advanced-walkthroughs.com

    *Only video files showed to allowed to be uploaded with exception of the MP4 and DVD formats.

    *Max file size allowed should be 80MB.

    *The uploaded files should be sent to a folder named "uploads" which I have already created. The address to the folder is www.advanced-walkthroughs.com/uploads.

    Please, help me out and write me the code. If any additional information is required, please do tell me and post here.

    Thank you....

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Quote Originally Posted by shahroz47 View Post
    If any additional information is required, please do tell me and post here.
    how much are you paying
    i doubt any body will write the whole script for you for free...
    but if you search these forums you can use the scripts from here...
    you should be able to find a script which works, you can then ask for our HELP to customise it to your needs....

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts

    Oh alright.

    The php

    PHP Code:
    <?php

    $max_size 
    15//Your maximum file size(in mb);
    $direc_copy "uploads/"//Directory to copy to
    //Seperate with a comma
    $accepted_file_list "video,image"// the files types you will allow to be copied, Possible options are:
    //text,image,audio,video,application

    //DO NOT EDIT PAST THIS LINE IF YOU ARE CLUELESS

    $accepted_file_list explode(",",$accepted_file_list);
    $max_size = (($max_size 1024) * 1024);
    $submit $_POST['submit'];
    if (isset(
    $submit)){
           
    $filename $_FILES['file_upload'];
        
    $mime_type explode("/"$filename['type']);
         if ((
    $filename['size'] > 0) and ($filename['size'] < $max_size)){
            if (
    in_array($mime_type[0], $accepted_file_list)){
                
    copy($filename['tmp_name'], $direc_copy $filename['name']);
                
    $message "Your file has been uploaded.";
                } 
                else {
                    
    $message "Filetype not supported";
                    }
            } else {
                
    $message "File is outside of the allowed boundaries";
                }
    }
    ?>
    <form action="uploader_test.php" method="post" enctype="multipart/form-data" name="fileuploader" id="fileuploader">
    <input type="file" name="file_upload" id="file_upload">
    <input type="submit" name="submit" value="submit">
    </form>
    PHP Code:
    <?php echo($message "<br>" "The link is " $direc_copy $filename['name']); ?>

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    You were lucky, Im in the process of practising my php a little....

    I could filter out particular video types. But I am over it. There you go, the neatest, safest file uploader I could make.

    You could add:
    $accepted_video = "mpg,avi" etc.
    NO over it.
    Last edited by idalatob; 09-05-2007 at 12:18 PM.

  • #5
    New Coder
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You probably need a php developer man.

    I'm only a student but I would work for a low price for you via the internet some how?


  •  

    Posting Permissions

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