2

I am importing data using DataGrab and need to be able to link image files correctly in the File field.

I tried using this for the path to the image file:

{filedir_1}myimage.jpg

However, it doesn't work. What is the correct way to do this?

Here are the values I am uploading:

enter image description here

Thanks!

3

I remember running into this and the problem for me was running Synchronize ( Content > Files > File Upload Preferences ) for the upload destination. You also have to have previously uploaded the images yourself via ftp, as DataGrab doesn't do that. Here's a good rundown from the developer on images from a forum thread:

I am currently writing some better documentation on how to import images, but in the meantime, this is the best way to do it:

1) DataGrab won’t actually copy the images to the new server - you’ll have to FTP them to a valid File Upload directory.

When you have copied the files to the correct place, you’ll need to synchronise the folder from the Control Panels Content > Files > File Upload Preferences page.

2) The images will need in the correct format in the CSV/XML file.

This format is {filedir_1}your_image_name.jpg where the 1 is the id of the upload folder you have copied the files to. You can usually do this with a search and replace in the file.

  • Hi, it sounds like I am pretty close as I have done almost exactly that. The photos have been uploaded to the server and I did sync it. I just need to go back and double check. I will append the entry above to reflect a row of data. – fmz Jun 5 '13 at 16:47
  • If you look in the db in exp_files are there any rows created reflecting the image import at all? – Romans-8---31-39 Jun 5 '13 at 17:01
  • Hi Romans 8, I looked in the images folder and there was one image that was preventing syncing and someone else had uploaded images to the wrong folder, so it was a combination of issues. However, the {filedir_x} prefix on the images does work and synching is the proper step 2. Thanks for your help. – fmz Jun 5 '13 at 17:04
  • Glad you got it:) – Romans-8---31-39 Jun 5 '13 at 17:09

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.