Jump to content

westman

Members
  • Posts

    600
  • Joined

  • Last visited

Posts posted by westman

  1. ok i put the 1 line of code...<?php phpinfo();in the file...phpinfowhich is located near php.iniand the file is empty, i see nothing. plus in post 50 i am not getting any feed back at all.

  2. i just tried... if (empty($_FILES['video_upload'])) {echo 'vid not there!';$updateMsg_upload .= "vid not there!";}else{echo 'vid there!';$updateMsg_upload .= "vid there!";}if (empty($_POST['vid_name'])) {echo 'post not there!';$updateMsg_upload .= "post not there!";}else{echo 'post there!';$updateMsg_upload .= "post there!";}and got no feed back positive or negative.

  3. i used print_r ($_FILES['video_upload']); and did not get any info, am i using it the right way? you said "Don't worry, there's time to do that, the world isn't going anywhere." the world ends on 21.12.2012 i only have 14 days!

  4. i understand what you are saying that you help people to understand code. but i do not understand code i understand the logic better and if it took so long to correct a problem in script i will never forget how to do it next time. since the end of the world is in 14 days do you think you could help me never forget my script problem by helping me find it?

  5. how?i don't understand mush without a script example. could you pleas give me a error script and tell me where to put it, to find this problem otherwise ill be here 7 more days with the same problem. more info about my script.....in index.php i have this...

    <?php require("style/index_core.php");?>

    and all my coding is in index_core.php

  6. ok i got an error.... Fatal error: Uncaught exception 'UploadException' with message 'Unknown upload error' in /home/content/31/......./html/...../style/index_core.php:1759 Stack trace: #0 /home/content/31/......../html/...../index.php(3): require() #1 /home/content/31/.........../html/......../index.php(3): require('/home/content/3...') #2 {main} thrown in/home/content/31/............/html/...../style/index_core.php on line 1759 on line 1759 i have.... throw new UploadException($_FILES['file']['error']); what does the error mean? and how do i get it working?

  7. i tried using .... class UploadException extends Exception { public function __construct($code) { $message = $this->codeToMessage($code); parent::__construct($message, $code); } private function codeToMessage($code) { switch ($code) { case UPLOAD_ERR_INI_SIZE: $message = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; break; case UPLOAD_ERR_FORM_SIZE: $message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"; break; case UPLOAD_ERR_PARTIAL: $message = "The uploaded file was only partially uploaded"; break; case UPLOAD_ERR_NO_FILE: $message = "No file was uploaded"; break; case UPLOAD_ERR_NO_TMP_DIR: $message = "Missing a temporary folder"; break; case UPLOAD_ERR_CANT_WRITE: $message = "Failed to write file to disk"; break; case UPLOAD_ERR_EXTENSION: $message = "File upload stopped by extension"; break; default: $message = "Unknown upload error"; break; } return $message; }} // Use if ($_FILES['file']['error'] === UPLOAD_ERR_OK) { //uploading successfully done } else { throw new UploadException($_FILES['file']['error']); } near ////// DB info input herein my script but am still not getting any errors. when i upload a file 47 MB in size it gets to 100% and then nothing happens, looks like a page refresh.

  8. so what could it be? this is my full upload script...

    if ($_FILES['video_upload']['tmp_name'] != "") {$maxfilesize_vid = 104857600;if($_FILES['video_upload']['size'] > $maxfilesize_vid ) {	    $errorMsg_upload = "Your Video was too large. Must be 22MB or less, please try again.";	    unlink($_FILES['video_upload']['tmp_name']);}else if (!preg_match("/\.(avi|mp4|wmv|mov|flv|swf)$/i", $_FILES['video_upload']['name'] ) ) {	    $errorMsg_upload = "Your Video was not .avi, .mp4, .wmv, .mov, .flv or .swf and it must be one of those 6 formats, please try again";	    unlink($_FILES['video_upload']['tmp_name']);} else {$find_fileinfo_video = mysql_query("SELECT * FROM vid ORDER BY id DESC LIMIT 1") or die (mysql_error());$find_fileinfo_video_check = mysql_num_rows($find_fileinfo_video);if ($find_fileinfo_video_check == 0){$vid_file_id = "1";}else{while ($row = mysql_fetch_array($find_fileinfo_video)) {$vid_file_id = $row["id"];}$vid_file_id++;}mkdir("vid/$vid_file_id", 0755);$newname1 = "myvid.mp4";if (move_uploaded_file($_FILES['video_upload']['tmp_name'], "video/$vid_file_id/".$newname1)) { $video_image_y_n = "0";if ($_FILES['video_image']['tmp_name'] != "") {$maxfilesize = 43554432;if($_FILES['video_image']['size'] > $maxfilesize ) {	    $errorMsg_upload = "Your Video image was too large. Must be 4MB or less, please try again.";	    unlink($_FILES['video_image']['tmp_name']);}else if (!preg_match("/\.(gif|png|jpg|jpeg)$/i", $_FILES['video_image']['name'] ) ) {	    $errorMsg_upload = "Your Video image was not .gif, .png or .jpg and it must be one of those 3 formats, please try again";	    unlink($_FILES['video_image']['tmp_name']);} else {$newname7 = "myvid.gif";if (move_uploaded_file($_FILES['video_image']['tmp_name'], "video/$vid_file_id/".$newname7)) { $video_image_y_n = "1";} else {$video_image_y_n = "0";}}}////// DB info input here  $updateMsg_upload = "You successfully uploaded a Video.";} else {$errorMsg_upload = "There was an error uploading your video, please try again. If it continually fails, please contact us.";}}}

×
×
  • Create New...