I successfully created an upload field in create mode in jQuery jTable as follows:
upload: {
title: 'Upload Image',
input: function (data) {
return '<input type="file" name="file">';
'<input type="submit" value="Submit" id="submitBtn" />';
},
},
I am able to successfully display the browse button and select files. I am unable to submit the form:
Error: newcourse.php' not found or unable to stat.
with the same file name in which the code is.
I am at a dead end. Where will the file be uploaded to? In the same directory? How to do it in jTable ? Can it be done using ajax ? If so, how to proceed? jTable documentation is very poor.
Hello shels
I lost a lot of time to searching of a solution of this issue. I read a many articles and found that this solution working for me fine:
...
....
How to capture submit response in a form created dynamically?
So you can capture submit event using: ...
And save data to the server side script. I think, it's a good solution and hope will be helpful.
Best Regards
Kameliya
console.log not working for FormData. Use instead
I finally found a soluton to upload files on jTable Now with the version of jtable 2.4.0 (the most recent at the moment writing this post)
on your file.js add the following methods:
Now, you are able to process the files on your server side.
That's all folks.