Hi all of you,
I have a problem with my vedio upload script. I wrote the script then i test it over images and files, It is working fine. But when i'm using it with larger files like vedio files the following error is appear "Fatal error: Maximum execution time of 30 seconds exceeded in /ftpfileupload.php on line 26 "
the script is uploading ny type of file to the server through the ftp connection.
who cn tll wht i can do so tht i can upload large file like vedio files.
the script i as follow :
CODE
<?php
// variables
function uploadfile()
{
$ftpServer = "your ftp server";
$ftpUser = "ftpusername";
$ftpPass = "ftppassword";
$finalDir = 'path wehre to put the vedio file ';
$finalFile = $finalDir . $_FILES['uploadFile']['tmp_name'];
$sourceFile= $_FILES['uploadFile']['name'];
// Connect and echo result
$ftpConn = ftp_connect("$ftpServer");
$ftpResult = ftp_login($ftpConn, $ftpUser, $ftpPass);
ftp_pasv($ftpConn, true);
if ((!$ftpConn) || (!$ftpResult))
echo "Connection failed<br><br>";
else
echo "Connection succeeded<br><br>";
// upload the file
$ftpUpload = ftp_put($ftpConn, $sourceFile, $finalFile, FTP_BINARY);
// check upload status
if (!$ftpUpload)
echo "FTP upload has failed!";
else
echo "Uploaded $sourceFile to $ftpServer as $finalFile";
//close the FTP stream
ftp_close($ftpConn);
}
uploadfile();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" enctype="multipart/form-data" action="ftpfileupload.php">
<input name="uploadFile" type="file" class="style14" >
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
I am waiting for your help. you can send me your working reply at
mmbk@yemen.net.ye.
[cod edit] please use code tags!
This post has been edited by hotsnoj: 19 Nov, 2006 - 09:15 PM