jQuery UI Widgets › Forums › General Discussions › File Upload
This topic contains 4 replies, has 3 voices, and was last updated by Twicsyko 6 months ago.
-
AuthorFile Upload Posts
-
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>- Name: <?php echo $_POST[“Name”]?>
- Address: <?php echo $_POST[“Address”]?>
- Address Line 2: <?php echo $_POST[“addressLineTwo”]?>
- Post Code: <?php echo $_POST[“postCode”]?>
- Service: <?php echo $_POST[“dropdownValue”]?>
- Message: <?php echo $_POST[“radiobuttonValue”]?>
- Check 1: <?php echo $_POST[“checkboxValue1”]?>
- Check 2: <?php echo $_POST[“checkboxValue2”]?>
- Check 3: <?php echo $_POST[“checkboxValue3”]?>
- FileName: <?php echo $_POST[“fileToUpload”]?>
Thanks for any help.
Best Regards,Steve.
Hi Steve,
It is $(“#fileUpload”).jqxFileUpload(“fileInputName”);
Regards,
PeterBest regards,
https://www.jqwidgets.com/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>- Name: <?php echo $_POST[“Name”]?>
- Address: <?php echo $_POST[“Address”]?>
- Address Line 2: <?php echo $_POST[“addressLineTwo”]?>
- Post Code: <?php echo $_POST[“postCode”]?>
- Service: <?php echo $_POST[“dropdownValue”]?>
- Message: <?php echo $_POST[“radiobuttonValue”]?>
- Check 1: <?php echo $_POST[“checkboxValue1”]?>
- Check 2: <?php echo $_POST[“checkboxValue2”]?>
- Check 3: <?php echo $_POST[“checkboxValue3”]?>
- FileName: <?php echo $_POST[“fileToUpload”]?>
- FileName2: <?php echo $(“#fileUpload”).jqxFileUpload(“fileInputName”);?>
Thanks for your help.
Best Regards,
Steve.
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,
PeterBest regards,
https://www.jqwidgets.com/Thank you
-
AuthorPosts
You must be logged in to reply to this topic.