Hey,
I want to dynamically send an upload form to CI via jQuery. The form needs to contain the file to be uploaded and the path to save to.
So far my AJAX-call looks like this:
file = $('#file').val();
path = active_dir;
upload_file( file, path );
function upload_file(file, path) {
$.post("/upload_file/", { file: file, path: path }, function(data) {
notice(data);
});
}
The PHP-side of the script is tested and OK. And the path is processed as it should. But I get an error message from PHP that says that ‘No file was selected.’.
How should I fetch the file data from the form?
Thank you, Christoffer