input type=file and php

Discussion in 'PHP' started by Amator, Jul 5, 2009.

  1. #1
    Hi all
    I am busy building a HTML form to enter text data and upload pictures to insert properties in a database.
    I have some question about the input type="file" tag.

    When you submit the form and you entered some wrong information in the form I want to show an error and then show the previous entered values using the value= argument.
    This works for the text fields but not for the input type=file fields.

    Is there any way to solve this or accomplish this ?
    Thanks
     
    Amator, Jul 5, 2009 IP
  2. jam4517549

    jam4517549 Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    $file_input = $_FILES['userfile'];
     
    jam4517549, Jul 5, 2009 IP
  3. Amator

    Amator Well-Known Member

    Messages:
    1,424
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Thanks but I think you misunderstood my question.
    Reading the value is no problem.
    What I try is to show this value in the input type='file' form field.
     
    Amator, Jul 5, 2009 IP
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm not 100% but I don't think this is possible
     
    wd_2k6, Jul 5, 2009 IP
  5. Wrighty

    Wrighty Peon

    Messages:
    199
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This unfortunately isn't possible! :(
     
    Wrighty, Jul 5, 2009 IP
  6. Amator

    Amator Well-Known Member

    Messages:
    1,424
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #6
    That is a pitty. Anyway, thanks for your help.
     
    Amator, Jul 7, 2009 IP