Cant get upload class to work.
Posted: Fri Dec 16, 2011 9:04 am
Hi
This is my first post and dont know if this is the exact place to post it but here goes.
Basically i am using this to upload video to the server from admin of clients new website.
I am using this like this:
I get the following php errors:
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 42
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 43
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 47
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 48
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 49
and then the final error report from the class is as follows:
E_INVALID_FILE_NAME
But that error is not correct as the file is the correct mp4 as allowed whitelist is telling it to accept.
This is my first post and dont know if this is the exact place to post it but here goes.
Basically i am using this to upload video to the server from admin of clients new website.
I am using this like this:
if($video_mp4['size'] == 0){ $errors[] = "No MP4 Video Was Inserted"; } else { if($video_ogv['size'] == 0){ $errors[] = "No OGV Video Was Inserted"; } else { $video_mp4 = new secure_upload('video'); $video_mp4->set_type_whitelist(array('video')); $video_mp4->set_extension_whitelist(array('mp4')); $video_mp4->save_to('/video/main/' . $video_mp4->name); if ($video_mp4->error > 0){ $errors[] = "Your mp4: " . $video_mp4->get_error_constant_name(); } else { $video_ogv = new secure_upload('video'); $video_ogv->set_type_whitelist(array('video')); $video_ogv->set_extension_whitelist(array('ogv')); $video_ogv->save_to('/video/main/' . $video_ogv->name); if ($video_ogv->error > 0){ $errors[] = "Your OGV: " . $video_ogv->get_error_constant_name(); } else { //insert into database here returnheader("/admin-area/dash/"); }
I get the following php errors:
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 42
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 43
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 47
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 48
Notice: Undefined index: video in C:\wamp\www\applications\controllers\upload-class.php on line 49
and then the final error report from the class is as follows:
E_INVALID_FILE_NAME
But that error is not correct as the file is the correct mp4 as allowed whitelist is telling it to accept.