input type=file...
input type=file...
Hello
I need to set an editor form to replace this one
<form method='post' action='import.php?Fo=".$OperationID."' enctype='multipart/form-data'>
<input type='file' name='".$fName."' accept='.txt,.csv'>
<input type='hidden' name='MAX_FILE_SIZE' value='2097152'>
<input type='button' value='Annuler' onClick='window.close()'>
<input type='submit' value='Envoyer'>
</form>
Using the 'upload' type the file load occurs after file selection... and I don't want it to load before user click on submit button...
I just want just to get the filename, display it and after user click on submit button, do check content manually (not after select the file)...
Is there a way to get this running (perhaps just an upload file option) ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Unfortunately not at the moment. The file upload input type is always async in Editor at this time. Providing a synchronous option is something we will look into in future.
Allan
Thanks Allan
So is there a way to simulate a file input and keep the same aspect as the rest of application (using render or other) ?
The only way to do it would be to create a field type plug-in that would read the file locally and then return the file's value (perhaps as a base64 string) as part of the form. That would work just fine, but I don't have such a plug-in available I'm afraid.
Allan
Hello Allan
In fact I just need to get the file name, not the file content...
So you don't use the content from the file at all? I suppose you could use
preUpload
to get information about the file and then write it into the value of a different field, but the upload field wasn't designed with that in mind.I'd actually suggest writing a custom upload field plug-in if all you want is the file name (although I'm not clear on why you wouldn't want the content as well).
Allan
Oh - I think I get it having thought about it a little more. What you mean is that you want the file name to be shown and then the file be submitted when the form is - is that correct?
If so, then my previous answer applies. You'd need a custom field plug-in to do that. What you are looking for (file upload inline with the rest of the form) is not something that Editor currently does as I mentioned above.
Allan
Hello Allan
Sorry to late response
Yes I just want to get the filename, nor get content at this time. This is an csv import file openened in an import module that check a lot of cases before accept import, so with fileupload the import module is directly fired, what I don't want to...
I'm sure a simple getfilename (as windows interface do in commondialog.dll) shoul be usefull for a solution.
Thanks for time lost for me