Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

File input doesnt show up in $_POST

I have this input form field:

              <div class="inputContainer">
                <img src="images/3_randomfilm.jpeg" alt="image" width="100">
                <label for="radioEdit1" class="labelForm radioLabel">Afbeelding
                        <input type="radio" name="radio" value="radioAfbeelding" id="radioEdit1" onclick="showEditInput('file')" checked />
                        <span class="checkmark"></span>
                </label>
                <label for="radioEdit2" class="labelForm radioLabel">Video
                    <input type="radio" name="radio" value="radioYoutube" id="radioEdit2" onclick="showEditInput('url')"/>
                    <span class="checkmark"></span>
                </label>
                        <input type="file" id="fileEditInput" name="fileEditInput" class="input hidden" accept="image/png, image/jpg, image/gif, image/jpeg">
                        <input type="url" id="urlEditInput" name="youtube_url" class="input hidden" value="">
              </div>

When I try to post this, everything posts except the fileEditInput. I just dont get it… Why does this not post?

 <input type="file" id="fileEditInput" name="fileEditInput" class="input hidden" accept="image/png, image/jpg, image/gif, image/jpeg">

This is how I post it in PHP if you want to know:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

$_POST['fileEditInput']

I tried giving it another name, but I just dont know how this can be wrong. Maybe I mistyped something but right now I cant just see it…

I hope you all can help me…

>Solution :

Try using $_FILES instead of $_POST

Files uploaded through a form will be in $_FILES and not in $_POST. The rest of the form data will be in $_POST.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading