Question

I'm trying to send a pfd file from an html forms

It's being called from UploadNewNewsletter.php

<html>
<body>
    <form action="./queries/upload_newsletter.php" method="post" enctype="multipart/form-data">
        Newsletter: <input type="file" name="news"><br>
        <input type="submit">
    </form> 
</body>
</html>

And being received in upload_newsletter.php

<?php
$target_path = "../PDFNewsletters/";
$target_path = $target_path . basename( $_FILES['news']['name']);

echo '$target_path';
?>

When I submit a file under about 7.5mb it echoes ../PDFNewsletters/<filename.pdf> but anything over that echoes just ../PDFNewsletters/

And finally, the post request looks like

------WebKitFormBoundarypc53TBYKknpKG8A6
Content-Disposition: form-data; name="news"; filename="Homework20.pdf"
Content-Type: application/pdf

------WebKitFormBoundarypc53TBYKknpKG8A6--

I set post_max_size = 40M although when i set post_max_size = 0M it still sends in a text field's data if I were to add it to the html file, so i'm not positive I'm even in the correct php.ini.default file.

Why would it send in the filename and not the data?

UPDATE It does work for .jpg files which makes me think I have the wrong php.ini.default file

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top