I’d like to know what’s the best way to store a MultipartFile (org.springframework.web.multipart.MultipartFile) field into Neo4j db.
It seems I should convert it (org.springframework.core.convert.converter.Converter) somehow. Maybe to a String[].
My use case is: I have a node Person who has a photo property (MultipartFile).
Then, I’d like to store and retrieve the photo.
Should I save it into the FileSystem? Why?
Does anyone have any tip?
I assume you mean
org.springframework.web.multipart.MultipartFile… So the question is what do you want to save in the database? The whole file including binary raw data?Although it is possibe to save byte[], I wouldn’t recommend it. Instead I suggest to store the files into filesystem and keep only a few relevant data in the database (e.g. the filename, storage location, file size, content-type and so forth).
Furthermore you’ll need some kind of mapping from
MultipartFileto the specificPropertyContainer(Node or Relationship).I suggest to check out SDN: http://www.springsource.org/spring-data/neo4j