Batch image file uploading

please tell me there is an easier way than uploading one file at a time like im doing now.

Oh, hell yeah.


Take a look at /path/to/matrix/scripts/import/import_files.php – that will batch upload binary files from the filesystem for you.

newbie question:


how i run it?



i picoed it and check the comments… import folder set to the id of the parent asset to be added to… thats fair enough…



command line to run it?



and i assume the tailing arguments will be e.g. import/20

Yup, you run it on the command line with two parameters, the SYSTEM_ROOT and the IMPORT_ROOT, like so:

    # php scripts/import/import_files.php /path/to/matrix /path/to/import


Inside the /path/to/import would be directories named after Asset IDs, like so:

    /path/to/import
      |
      |- 100
          |- file1.pdf
      |-200
          |-file2.pdf


Will import "file1.pdf" under Asset ID #100 and "file2.pdf" under Asset ID #200.

Make sense?

Avi,


If I want to import files into a certain folder in a site what does the import file code look like?



The site structure is:



Conferences and events (site asset #23350)

->Sports Technology Conference (standard page #23351 )

–>Papers (Folder asset #23355)



I want all assets to go into the papers folder.



Can you please advise.



Cheers.

Create a folder called Import. Inside that, create a folder called 23355. Put the PDFs inside that folder. Run the script, pointing at the Import folder. :slight_smile:

forgot to thank you for this ages ago avi…


Thanks Avi

When batch uploading, is there a way to specify the link type of the file when it is uploading?


I'd like them to be link type 2

You may have to edit the script for this. If you submit a request to the Support Team, we can take a look at it.