file path (without upload)
file path (without upload)
i am looking to load data from an xml file into a table with a view to importing relevant fields into my database table.
I have managed to point to a named xml file and convert the content to json in order to display some of the fields in a table.
what i would like to do is allow the user to point to an xml file on their client machine - without the need to upload it to the server
i have used the upload field type successfully before, but I don't actually want/need to upload it
rather than try and create a custom field type, could i just use the upload field type and use the preupload event to cancel upload after the client side validation is performed ?
This question has an accepted answers - jump to answer
Answers
Hi,
Good question! So what to do here is make use of the
preUpload
event. It is cancellable, so you can justreturn false;
from the event handler and it will stop the file from actually being uploaded to the server. But you'll also have access to the file so you will be able to read and parse the XML, setting the values as needed in the Editor from based on the XML.Allan
Awesome- cheers Allan