Jump to content
php.lv forumi

Video upload problema


tikkai maacos

Recommended Posts

Sveiki... meeginu uploadot video virs 30mb

 

mazinjie uloadojas lielie nea

 

ieksh .htaccess ir shaadas veertiibas!

php_value max_execution_time 3600

php_value post_max_size 55M

php_value max_input_time 3600

php_value upload_max_filesize 55M

 

pats kods ir shaads

<form action="" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label><input type="file" name="file" id="file" /><br />
<input type="hidden" name="ok" value="ok" />
<input type="hidden" name="MAX_FILE_SIZE" value="419430400" />
<input type="submit" name="submit" value="Submit" />

</form>
<?php
if ($_POST['ok']){
ini_set('max_execution_time', '3600');
if (($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/mpeg")){
if ($_FILES["file"]["size"] < 419430400){
 {
//
 if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
 else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

if (file_exists("upload/" . $_FILES["file"]["name"]))
  {
  echo $_FILES["file"]["name"] . " already exists. ";
  }
else
  {
  move_uploaded_file($_FILES["file"]["tmp_name"],
  "upload/" . $_FILES["file"]["name"]);
  echo "Stored in: " . "upload/" . $_FILES["file"]["name"];

  }
}
 }
}
else{echo "Video ir pa lielu! Maksimālais izmērs ir 50MB";}
}
else
{
 echo "Neparizs fails atljautie faili ir *.avi un *.mpeg";}
?>

 

un joks taads ka nav nekādu erroru!

 

P.S. hostings = nano.lv

 

Paldiess!

Link to comment
Share on other sites

Pamegini pec shitas rindas izvadit, ko satur failu masivs, apskaties kads kludas tips ir pie error, jo varbut kaut kas nav ar tiem failiem ko megini uzlikt tips nesakrit un tik talu, pat kods neizpildas.

 

if ($_FILES["file"]["size"] < 419430400){
 print_r($_FILES);

Link to comment
Share on other sites

Iespējams, ka uz nano.lv aizliegts mainīt maksimālo faila izmēru caur .htaccess ...

uz nano serveriem staav webi ar video upload... neticu ka vinji liek mazus video!

Directive Local Value Master Value

max_execution_time 3600 40

max_input_nesting_level 64 64

max_input_time 3600 60

memory_limit 150M 150M

post_max_size 55M 8M

 

Pamegini pec shitas rindas izvadit, ko satur failu masivs, apskaties kads kludas tips ir pie error, jo varbut kaut kas nav ar tiem failiem ko megini uzlikt tips nesakrit un tik talu, pat kods neizpildas.

 

CODE

if ($_FILES["file"]["size"] < 419430400){

print_r($_FILES);

 

Nekas neparaadas... tikkai atkal pievienoshanas forma no jauna!

Edited by tikkai maacos
Link to comment
Share on other sites

Tad ir vaina tipos, if'i neizpildas vai posts, ko nosuti. Varbut nomaini if ( isset($_POST['ok']) ), pamegini pirms shita print_r($_FILES)

 

if ($_POST['ok']){
ini_set('max_execution_time', '3600');
if (($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/mpeg")){
if ($_FILES["file"]["size"] < 419430400){

Edited by cucumber
Link to comment
Share on other sites

Tad ir vaina tipos, if'i neizpildas vai posts, ko nosuti. Varbut nomaini if ( isset($_POST['ok']) ), pamegini pirms shita print_r($_FILES)

 

if ($_POST['ok']){
ini_set('max_execution_time', '3600');
if (($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/mpeg")){
if ($_FILES["file"]["size"] < 419430400){

 

ja ir nepareizs tips tad vinsh taa ari pasaka....

 

tavs ieteiktais variants arii nesanaaca.... formu atstaaju ieksh viena faila un php ieksh otra... un taapat nekaa.... balta bilde un viss.....

varbuut ir veel kaads ieteikums.... google.lv saka ka vajag visu ko mainiit ieksh .htaccess un mainiiju bet nekaa....

Link to comment
Share on other sites

Tad pamegini izmainit ar ini_set(); upload lielumu un iesledz error reporting ieksha.

Link to comment
Share on other sites

Tad pamegini izmainit ar ini_set(); upload lielumu un iesledz error reporting ieksha.

ir iesleegts.... nekas.. pilniiigi nekas.... sha zvaniishos un lamaashos :D

 

laikam nav lemts....

EDIT:

Labs ir.... sleedzam ciet... pie visa vainiigs nano.lv vinji var tikkai reguleet upload lielumus!

 

paldies par atsauciibu... :)

Edited by tikkai maacos
Link to comment
Share on other sites

ja, sajaucu ar memory_limit

Link to comment
Share on other sites

×
×
  • Create New...