file path (without upload)

file path (without upload)

crush123crush123 Posts: 417Questions: 126Answers: 18

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

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Hi,

    Good question! So what to do here is make use of the preUpload event. It is cancellable, so you can just return 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

  • crush123crush123 Posts: 417Questions: 126Answers: 18

    Awesome- cheers Allan

This discussion has been closed.