Hey. Dieser Code funktioniert in den meisten Browsern und teilweise auch in IE6. Es lädt Dateien weniger als 10 MB (ungefähr), aber nichts größeres. Der Code gibt an, dass diese Dateien zulässig sind.Problem beim Hochladen von Dateien größer als 10 MB in IE6
Beachten Sie auch, dass es so aussieht, als ob die gesamte Datei auf die Server übertragen wurde, bevor sie ignoriert wurde.
Die Website befindet sich unter: www.mgxvideo.com/mgxcopy-alpha-3/ und kann durch Hinzufügen eines Artikels im Warenkorb und anschließendes Klicken auf die Upload-Funktion erreicht werden. Ideen? Hier
ist die Form:
<form enctype="multipart/form-data" action="upload_files.php?order_id=<?php echo $_GET['order_id'] ?>" method="POST">
<table style="width:100%">
<tr>
<td valign="top">
<span class="style1">Choose a file to upload: </span>
</td>
<td valign="top">
<input name="uploadedfile" type="file" />
</td>
</tr>
</table>
<input type="submit" value="Upload File" />
<input type="hidden" name="action" value="add"/>
<input type="hidden" name="MAX_FILE_SIZE" value="100000000" />
</form>
Hier ist eine Linie, an der Spitze der upload_files.php:
$upload_output = upload_file($customer_id, $_REQUEST['action'], $_GET['order_id'], $_FILES);
Und hier ist der UPLOAD_FILE() Code:
function upload_file($customer_id, $action, $upload_id, $FILES)
{
$target_path = "uploads/";
$target_path = $target_path . $customer_id . '_' . $upload_id . '_' . basename($FILES['uploadedfile']['name']);
$str_output = '';
if ($action == 'del' and file_exists($_POST['filepath']))
{
delete_file($customer_id, $_POST['filepath']);
$str_output = '<span class="style1">File successfully deleted. If you are done uploading files, ' .
'<a href="#" onclick="self.close();">click here</a> to close this window.</span>';
setcookie("upload_out_txt", $str_output, time() + 300);
setcookie("upload_out_b", "1", time() + 300);
} else if ($action == 'add')
{
if (count_uploads($customer_id, $upload_id) >= 2)
{
$str_output = '<span class="style1">Problem: You have reached the maximum allowed uploads for this particular order. Please delete a file before continuing.</span>';
setcookie("upload_out_txt", $str_output, time() + 300);
setcookie("upload_out_b", "1", time() + 300);
} else if (file_exists($target_path))
{
$str_output = '<span class="style1">Problem: A version of the file you are trying to upload already exists. Please delete the file from out servers before uploading again.</span>';
setcookie("upload_out_txt", $str_output, time() + 300);
setcookie("upload_out_b", "1", time() + 300);
} else if (move_uploaded_file($FILES['uploadedfile']['tmp_name'], $target_path))
{
insert_to_database('uploaded_files', array($customer_id, $upload_id, 'now()', $target_path));
$str_output = '<span class="style1">Success. The file was successfully uploaded. If you are done, <a href="" onclick="window.close();">click here to close the window</a></span>';
setcookie("upload_out_txt", $str_output, time() + 300);
setcookie("upload_out_b", "1", time() + 300);
} else
{
$str_output = '<span class="style1">There was an error uploading the file, please try again!</span>';
setcookie("upload_out_txt", $str_output, time() + 300);
setcookie("upload_out_b", "1", time() + 300);
}
}
return $str_output;
}
Hier ist meine php.ini-Datei, nachdem ich versucht habe, einen Fix zu implementieren:
extension_dir="/kunden/homepages/30/d93769495/htdocs/extensions";
extension=uploadprogress.so;
upload_max_filesize=150M;
post_max_size=210M;
max_input_time=1800;
file_uploads=1;
memory_limit=240M;
max_execution_time=1800;
geändert, aber ohne Erfolg – montooner
Die 'MAX_FILE_SIZE' hat absolut keinen Einfluss auf den Client. In der Tat könnten Sie es einfach entfernen. –
Es stimmt, dass kein Browser darauf achtet. Aus irgendeinem Forum las ich:. „Das MAX_FILE_SIZE verstecktes Feld (in Bytes gemessen), um die Datei Eingabefeld vorangestellt werden muss, und sein Wert ist die maximale Dateigröße akzeptiert Dies ist ein Beratungs an den Browser , PHP überprüft es auch. Das Austäuschen dieser Einstellung auf der Browserseite ist ziemlich einfach, also verlassen Sie sich nie darauf, dass Dateien mit einer größeren Größe durch diese Funktion blockiert werden. " –