M
M
mewithoutyou2019-04-26 23:01:17
JavaScript
mewithoutyou, 2019-04-26 23:01:17

How to implement the loading of images specified in CSV?

Hello. I am trying to implement the following functionality:
1) I upload a CSV file with the following data to the server, this is the cafe menu:

Овощной омлет	Омлет с брокколи, стручковой фасолью, помидорами и свежей зеленью.	99	250 г	ovoshchnoy-omlet
Омлет с курицей и грибами	Воздушный омлет с куриным филе, шампиньонами, моцареллой и свежей зеленью.	169	300 г	omlet-s-kuritsey-i-gribami

2) Each line is a dish and a record is created for it in the database. The last column is the name of the picture.
What I encountered - it's not clear how to implement image loading? That is, at first I thought that I was uploading a file, next to which the images folder with pictures would lie, I pulled out the path from the loaded csv file, substituted images and from there everything loaded ... But as it turned out, due to security, the full paths are in the browser are not given :) There is no such functionality as selecting a folder through the system window (like selecting a file, only folders) or I was looking badly, at least a way without hacks.
Anyone have any ideas how this can be done without shooting yourself in the foot? So far, I think that I will have to make two fields - one for the CSV file, and the second - multiple input for images that I will throw there from the mentioned images folder.
On the front I use VueJS 2, on the backend I use Node.JS / Express (with multer).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2019-04-26
@mewithoutyou

The choice of a folder for loading is and works without hacks.
https://caniuse.com/#feat=input-file-directory

V
Vladimir Skibin, 2019-04-29
@megafax

And what's the problem with loading the archive? The archive contains a csv file + a set of pictures that are actually needed for import.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question