Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Why can't I upload a video title with a video using php and plupload?

I'm trying to make a video uploading system with plupload that also takes a video title and puts it in a database. The video uploader works fine, but as soon as I try to add a separate input field for a title it doesn't work. I tried making a separate button for setting the title, but that didn't work either. Here's the HTML form:

<form id="uploadTitle" action="upload.inc.php" method="POST">
      <input type="text" name="title" placeholder="Video Title">
      <button class="browse" id="browse" href="javascript:;">Browse</button> 
      <button class="start-upload" id="start-upload" type="submit" href="javascript:;">Upload</button>
</form>

I have an error handler in my upload.inc.php:

if (empty($_FILES) || $_FILES['file']['error']) {
    die('{"OK": 0, "info": "Failed to move uploaded file."}');
}

It throws me this error every time I try to upload a video. I insert the file name / video url into the database just after plupload checks if the file has been uploaded and that works fine, so I modified it to also add the title:

$sql = "INSERT INTO videos(video_url, title)
        VALUES('$generatedName', '$title')";
mysqli_query($conn, $sql);
die('{"OK": 1, "info": "Upload successful."}');

Any help is appreciated!

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

If you are trying to upload a file first need to add the attribute enctype= multipart/form-data to the form, Then you need an input type file, don't forget the name attribute name='something'

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!