Hi all,

I have a upload script but since i need to upload files of 200mb with week connections i was thinking on splitting the file and then upload the several files, in the end it would reasemble the file again.

Can this be done?

thanks

You can see my upload script bellow.
HTML Code:
<?php
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . 'error_log.txt');
error_reporting(E_ALL);

$s =$_GET['s'];
if( is_null($s)){
     echo '<meta http-equiv="refresh" content="0, index.asp" />';
}
if($_SERVER['REQUEST_METHOD']=='POST')
{
set_time_limit(0); 
$out = array('error'=>null);

$stud =$_GET['stud'];
$pat =$_GET['pat'];
$novonome =$_GET['novonome'];
$arquivo =$_FILES['arquivo'];

$dir =$stud."/".$pat."/";
$caminho =$novonome;

$servidor ='111.111.1.11';
$user='user';
$pass='2012';
$conn_id = ftp_connect($servidor) or die( 'No Connection!');


    if ($_FILES["arquivo"]=="") {
                $out['error'][] = "Please specify a file";
     }

     if ($arquivo['type'] == "multipart/x-zip" || $arquivo['type']== "application/zip" || $arquivo['type'] == "application/x-zip-compressed" || $arquivo['type'] == "application/x-compressed")
     {
         } else {
                $out['error'][] = "Only Zip files are allowed!";
     }
                
     if ($arquivo['size']>524288000) {
                $out['error'][] = "File upload limit is 500MB!";
     }
         
ftp_login( $conn_id, $user, $pass );

    if (count($out['error'])>0) {       
           foreach ($out['error'] as $msg) 
           {
           $message = '<p>'.$msg.'</p>';
       echo $message;
       echo "<br><form><input type=\"button\" value=\"ERROR!! Please check your file and update again!\" onClick=\"javascript:history.go(-1)\"></form>";            
           }
        } else {

$rrr="C:/inetpub/wwwroot/upfil/".$dir;
if(!file_exists($rrr)) {
                 if (!in_array($pat, ftp_nlist($conn_id,$stud))) {
         ftp_mkdir($conn_id,$dir) or fail ($out['error'][] ="Cannot create directory $pat.");
        }
}
                ftp_put( $conn_id, $caminho, $arquivo['tmp_name'], FTP_BINARY);
            ftp_close($conn_id);            
         
             echo '<meta http-equiv="refresh" content="0, mail.asp?now=go&var=fich" />';
}  
}
?>
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>  <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>  <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>  <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<head>
        <meta charset="UTF-8">
    <title></title>
        <script src="modal/js/libs/jquery.min.js"></script>
        <script src="modal/js/libs/modernizr-1.7.min.js"></script>
    <link rel="stylesheet" href="modal/css/reset.css" media="all">
    <link rel="stylesheet" href="modal/css/style.css" media="all">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>  
</head>
<body>
<section id="cjModalWindow">
        <header>
        <h3>Choose File To Upload</h3>
        <a href="del.asp?var=dat" class="xClose"><img src="modal/images/x-close.png" alt="Close" title="Close"></a>
        </header>
   <article>
    <div id="loading" style="display:none;">Uploading. Please Wait!<img src="images/loading.gif" alt="" /></div>
    <form action="" method="post" enctype="multipart/form-data">
        <input type="file" name="arquivo" />
                <input type="submit" name="enviar" value="Send" onclick="$('#loading').show();">
        </form>
   </article>
    <footer>
        <img src="modal/images/expandNotation.png" class="expandNotation" title="Expand Window" alt="Expand Window">
    <br>
        Only Zip files are allowed!
        </footer>
</section>
<footer id="fMain">
        Coimbra
</footer>
</body>
</html>