...

View Full Version : Help with file uploading



shahroz47
09-02-2007, 07:44 AM
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....

rafiki
09-02-2007, 03:52 PM
If any additional information is required, please do tell me and post here.


how much are you paying :D
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....

idalatob
09-05-2007, 01:11 PM
The php


<?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 echo($message . "<br>" . "The link is " . $direc_copy . $filename['name']); ?>

idalatob
09-05-2007, 01:16 PM
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.

Lightro
09-05-2007, 01:17 PM
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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum