• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RM 1.1 Upload all a folder

#1
Hi,

i have a folder with 3500 pdf on my server. I would like to add thoses 3500 pdf on the ressources manager but not by uploading them one by one with my little hand.

its possible to add the complet folder and use the ressource manager option to creat a topic for each new one ?
 

Brogan

XenForo moderator
Staff member
#2
It's not possible to automatically create resources from a list of files.

You would need to manually create each resource.
 
#3
thx Brogan,

and with a script ?

i mean the script should take the name of the document without the .pdf and complet the form for each files. is that possible ? risked ?
othet solution: i list all files of the folder on a text document, remove the .pdf and creat a script who take this name to complet name and description and add the url + .pdf to complet the external link.

or if i already have all thoses 3500 files on the ressources manager but without topic created for each one. How can i "refresh" the ressources to make it creat à topic for each one ? ( i already try to rebuild cache but he don't creat topic )
 

0ptima

Well-known member
#6
thx Brogan,

and with a script ?

i mean the script should take the name of the document without the .pdf and complet the form for each files. is that possible ? risked ?
othet solution: i list all files of the folder on a text document, remove the .pdf and creat a script who take this name to complet name and description and add the url + .pdf to complet the external link.

or if i already have all thoses 3500 files on the ressources manager but without topic created for each one. How can i "refresh" the ressources to make it creat à topic for each one ? ( i already try to rebuild cache but he don't creat topic )

You could probably adapt this importer to import all the files
Beta - DownloadsII -> XenForo Resource Manager Importer
This importer creates a thread with an attachment and then converts it to a resource. The thread gets deleted, but you could comment out that part to prevent the delete.

You could probably create a CSV file with all the required info and have the addon read the file and process all the files.
Your csv file would need the following fields
  • filename
  • user ID
  • title
  • message text
  • node ID (for the thread)
  • Category ID (for the resource)
You can easily read the CSV into an array with the following
Code:
$csv = array_map('str_getcsv', file('data.csv'));
 
Last edited: