Search the Community
Showing results for tags 'php upload video'.
-
So there are three major problems in my script securityi will do this by my self... so dont judge me for issues in this specific topic i just started this... upload dir won't work instead it drops the file in the main dir where the index lays... and names it with vid instead of putting it to the vid dir it cant upload videos somehow...i already changed the ini so that files in size of 1gb can be uploaded on to the server. there are no errors displayed: Code: Vidbase.php -> public function doupload ($UID,$TAGS,$VTITLE,$VDESCRIPTION,$VIDEO,$QUESTIONS,$GENRE) { $dir = "../../VID"; $fname = $VIDEO['name']; $ftmp = $VIDEO['tmp_name']; $ftype = $VIDEO['type']; $fsize = $VIDEO['size']; $ferr = $VIDEO['error']; $fname = preg_replace("/[^A-Z0-9._-]/i", "_", $fname); if (!$ftmp) { $fmsg = "Error: youve not choosen a file please do so in order t upload a file."; return $fmsg; } if ($ferr !== UPLOAD_ERR_OK) { $fmsg = "An error occurred"; return $fmsg; exit; } $i = 0; $parts = pathinfo($fname); while (file_exists($dir . $fname)) { $i++; $fname = $parts["filename"] . "-" . $i . "." . $parts["extension"]; } $success = move_uploaded_file($ftmp, $dir . $fname); if (!$success) { $fmsg = "upload failed"; return $fmsg; } chmod($dir . $fname, 0644); $fmsg = "upload complete"; return $fmsg; } upload.php <?php if (isset($_POST['submit'])) { $vid->doupload($userRow['userId'],null,"TITLE","DESCR",$_FILES['file'],null,"tech"); } ?> <form id="upload_form" enctype="multipart/form-data" method="post"> <input type="file" name="file" id="file1"><br> <button name="submit">UPLOAD</button> <progress id="progressBar" value="0" max="100" style="width:300px;"></progress> <h3 id="status"></h3> <p id="loaded_n_total"></p> </form> any sugestions ?
- 3 replies
-
- php
- php upload video
-
(and 2 more)
Tagged with: