Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677580
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:14:19+00:00 2026-05-19T03:14:19+00:00

For some reason my PDF upload form is failing consistently, I have this code:

  • 0

For some reason my PDF upload form is failing consistently, I have this code:

<?php
if($_POST["submit"] == "Add PDF to Comm and Special Projects")
{
    $addsubp = $_POST["addsubp"];
    $addsubp_name = $_POST["addsubp_name"];
    $commuploadedfile = $_FILES['uploadedfile']['name'];
    $sqldoc = "INSERT INTO projects_links (pid, display_name, link) VALUES ('".$addsubp."','".$addsubp_name."','".$commuploadedfile."')";
    mysql_query($sqldoc) or die(mysql_error()); 
    echo "<BR>";
    $target_path = "D:\\Hosting\\69903\\html\\pdfs\\comm\\";    
    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "<br>The file ".  basename( $_FILES['uploadedfile']['name']). 
        " has been uploaded<br>";
    } else{
        echo "<br>There was an error uploading the file, please try again.<br>";
    }
}
?>
<form method="post">
Add PDF to Project for Committees and Special Projects <br>Choose Project<select name="addsubp"><?php

$query = "SELECT
projects.*
FROM
projects";
$showresult = mysql_query($query);
$csp_c = 1;
while($buyarray = mysql_fetch_assoc($showresult))
{
    echo "<option value=".$buyarray['id'].">".$buyarray["pname"]."</option>";
}

?></select><br>
Choose Display Name for PDF <input type="text" name="addsubp_name" /> <Br>
Choose PDF: <input name="uploadedfile" type="file" /> <Br>
<input type="submit" value="Add PDF to Comm and Special Projects" name="submit" />
</form>

I have made sure that the application has write privileges to the “comm” directory. I have godaddy and used the file manager to make sure of that. I have had problems with permissions in this project before, so I know this isn’t case. It keeps printing

There was an error uploading the file, please try again.

It doesn’t attempt to upload any PDF at all, what am I doing wrong?
thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:14:20+00:00Added an answer on May 19, 2026 at 3:14 am

    You may have permissions issues, but for file uploads your form tag should contain the proper enctype attribute.

    <form enctype="multipart/form-data" method="POST">

    and defining a file size limit is also a good idea:

    <input type="hidden" name="MAX_FILE_SIZE" value="1000000" />

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code and for some reason the !important qualifier isn't working.
For some reason I never see this done. Is there a reason why not?
For some reason the Windows command prompt is special in that you have to
I'm trying to use Python to run pdftotext, but for some reason, my code
For some reason I cannot do this on files inside bundles and files residing
For some reason when I attempt to make a request to an Ajax.net web
For some reason when I create a new namespace in Visual Studio 2008 its
For some reason, when I try to install SQL Server 2008 Express , I
For some reason, lately the *.UDL files on many of my client systems are
For some reason, Section 1 works but Section 2 does not. When run in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.