Welcome to Dream.In.Code
Become a PHP Expert!

Join 149,983 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,379 people online right now. Registration is fast and FREE... Join Now!




Uploading files, timeout

 
Reply to this topicStart new topic

Uploading files, timeout, having a problem with my video upload script

monsurvey1
15 Nov, 2006 - 05:14 AM
Post #1

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 3


My Contributions
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
User is offlineProfile CardPM
+Quote Post

Tuzoid
RE: Uploading Files, Timeout
15 Nov, 2006 - 06:00 AM
Post #2

D.I.C Head
Group Icon

Joined: 20 Aug, 2006
Posts: 120



Thanked: 2 times
Dream Kudos: 50
My Contributions
I guess FTP might work, but you can use move_uploaded_file();...I'm at school so I don't have any references...When I get home I'll check back to this topic.

Also, if someone has a working reply, post here. Don't email monsurvey. You might be able to help someone else!
User is offlineProfile CardPM
+Quote Post

monsurvey1
RE: Uploading Files, Timeout
18 Nov, 2006 - 04:56 AM
Post #3

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 3


My Contributions
Hi there again,
I'm still waiting for the answer. Any one can help.

thanx for your reply but I want the realiable solution. I said you will check and i'm waiting for your next reply and other this forum subscriber.

I'm witing for urgent and usefull reply.


User is offlineProfile CardPM
+Quote Post

Tuzoid
RE: Uploading Files, Timeout
18 Nov, 2006 - 06:05 AM
Post #4

D.I.C Head
Group Icon

Joined: 20 Aug, 2006
Posts: 120



Thanked: 2 times
Dream Kudos: 50
My Contributions
Your php.ini file has a set limit on how long a script can run, this is for security reasons. You should contact your host to see if you could edit this file, and maybe change this file. I think there is a different way to do this, but I can't think of it at the moment.

Sorry if I couldn't be of help!
User is offlineProfile CardPM
+Quote Post

monsurvey1
RE: Uploading Files, Timeout
19 Nov, 2006 - 04:28 AM
Post #5

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 3


My Contributions
thanx tupzoid for your reply i'll check that.
User is offlineProfile CardPM
+Quote Post

prasadkc
RE: Uploading Files, Timeout
2 Dec, 2006 - 02:47 PM
Post #6

New D.I.C Head
*

Joined: 2 Dec, 2006
Posts: 1


My Contributions
yes, you can mention the max file upload size limit in the php.ini file.
User is offlineProfile CardPM
+Quote Post

callumj
RE: Uploading Files, Timeout
7 Dec, 2006 - 05:03 PM
Post #7

New D.I.C Head
*

Joined: 8 Jan, 2006
Posts: 14


My Contributions
Depending on your host I think you can set the php.ini settings in your .htaccess
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 07:20PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month