0

I have a potential client (car dealership) where in their existing 12 year old site they daily upload an Excel file to add/update/delete vehicles in stock. One file for new vehicles and one for used.

However the excel file does not have a column for images and they are unwilling/unable to add one. Instead they want images to be added in the same way they currently are.

All images are ftp'd up to the server and are named ##_stocknumber so 01_12345, 02_12345, 03_12345 would be attached to the same entry but 01_4455, 02_4455, 03_4455, 04_4455 would be attached to a different entry. After upload the go to a link that processes the images and then emails any stock numbers that are missing images.

Is there some way that this can be achieved in Craft?

2

Since it sounds like you are using a third-party plugin for the initial import, you'll need a new plugin to handle the ftp uploads. This new plugin would need to perform the following:

  • Basic control panel page, or Controller action for firing off the processing
  • Get the list of new images files from the FTP directory
  • For each file:
  • At the end of the run, archive/remove the original uploaded files
  • Email the list of stocknumbers you have image files for but not existing entries (using EmailService)

To further optimize the process/queries you could query all vehicles first and pull them out of an array by the stocknumber (instead of querying the DB each file).

If you wanted to automate the process you could even build a task-listener to fire off your image-association plugin when it sees new images have been FTP'd to the vehicle image upload directory.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.