MIGXdb Action button to import directly upload csv file

I am trying to use one of the upload action buttons to upload and import data to a migxdb, I got it working in 2 steps, first upload a file, then use the importcsv button, that works. but I like to use only the upload button and then process the uploade file. I tryed adding the loadfromsource.php to my own package/processors/default. and changed the code a bit to see what I could do, but I do not get the uploaded files? Looks like it just opens a sertain mediasource and loops tru all files in that folder.

Is there a way to us the upload action and get the uploaded file reference?

And also overwrite if file is already there? the migx upload modal does not show the files, it only opens the upload.

Or even better, have an upload file in the import CSV action…

You could try changing the “inputTVtype” of the field “file” in the import window (that is used by the Action-Button “importcsvmigxdb”) to file (instead of the default textfield).

"inputTVtype":"file",

This allows you to open the MODX file browser to chose a file (or upload new ones).

That does work ok actualy, Can i also put this file in my own package instead of editing the original? or do I have to have a custom grid.config also?

Unfortunately, I don’t think so.

Theoretically the code checks if a config file (core/components/<package_name>/model/migxconfigs/importcsv.config.js) exists in the custom package folder and loads it here:

But then it gets immediately overwritten by the file core/components/migx/configs/importcsv.config.js here:

Not sure why!


Maybe you could create a pull request on Github to change the original code.
A “file” input field seems to me to be a better user experience than just a text field.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.