This topic contains 4 replies, has 3 voices, and was last updated by  Twicsyko 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    File Upload Posts
  • File Upload #134360

    Steve2106
    Participant

    Hi There,
    Where can I get the filename of the file chosen in the fileupload widget.
    I can get all the other details from a form but not the fileupload details.
    This is a bit of php I’m using.
    ` <h1>Thank You</h1>
    <p>Here is the information you have submitted:</p>

    1. Name: <?php echo $_POST[“Name”]?>
    2. Address: <?php echo $_POST[“Address”]?>
    3. Address Line 2: <?php echo $_POST[“addressLineTwo”]?>
    4. Post Code: <?php echo $_POST[“postCode”]?>
    5. Service: <?php echo $_POST[“dropdownValue”]?>
    6. Message: <?php echo $_POST[“radiobuttonValue”]?>
    7. Check 1: <?php echo $_POST[“checkboxValue1”]?>
    8. Check 2: <?php echo $_POST[“checkboxValue2”]?>
    9. Check 3: <?php echo $_POST[“checkboxValue3”]?>
    10. FileName: <?php echo $_POST[“fileToUpload”]?>

    Thanks for any help.
    Best Regards,

    Steve.

    File Upload #134363

    admin
    Keymaster

    Hi Steve,

    It is $(“#fileUpload”).jqxFileUpload(“fileInputName”);

    Regards,
    Peter

    Best regards,
    https://www.jqwidgets.com/

    File Upload #134378

    Steve2106
    Participant

    Hi Peter,

    That does not work in my scenario.
    I’ve added the code you suggest at the bottom of the code below and I get an error of “Parse error: syntax error, unexpected ‘(‘, expecting variable (T_VARIABLE) or ‘{‘ or ‘$’ in C:\xampp\htdocs\SteveTest\Results2.php on line 21”

    This is the code:
    <h1>Thank You</h1>
    <p>Here is the information you have submitted:</p>

    1. Name: <?php echo $_POST[“Name”]?>
    2. Address: <?php echo $_POST[“Address”]?>
    3. Address Line 2: <?php echo $_POST[“addressLineTwo”]?>
    4. Post Code: <?php echo $_POST[“postCode”]?>
    5. Service: <?php echo $_POST[“dropdownValue”]?>
    6. Message: <?php echo $_POST[“radiobuttonValue”]?>
    7. Check 1: <?php echo $_POST[“checkboxValue1”]?>
    8. Check 2: <?php echo $_POST[“checkboxValue2”]?>
    9. Check 3: <?php echo $_POST[“checkboxValue3”]?>
    10. FileName: <?php echo $_POST[“fileToUpload”]?>
    11. FileName2: <?php echo $(“#fileUpload”).jqxFileUpload(“fileInputName”);?>

    Thanks for your help.

    Best Regards,

    Steve.

    File Upload #134382

    admin
    Keymaster

    Hi Steve,

    I wrote you how to get the fileInput’s name in Javascript. I do not think that you can PHP echo it like that.
    For example, in the docs https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxfileupload/jquery-file-upload-getting-started.htm,
    we create it like that: $(‘#jqxFileUpload’).jqxFileUpload({ width: 300, uploadUrl: ‘upload.php’, fileInputName: ‘fileToUpload’ });.
    This means that when you submit a Form, the name is ‘fileToUpload’.

    Regards,
    Peter

    Best regards,
    https://www.jqwidgets.com/

    File Upload #134467

    Twicsyko
    Blocked

    Thank you

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.