Keeping csv files in one location - for uploading without file manager

Permalink 1 user found helpful
I have 4 files, all csv. they are called
cars, bikes, trains, boats.csv

These populate the csv displayer block.
I have a seperate file uplaoder script that will upload and overwrite each file, as and when needed. (they are all stored in one folder on my server)

My client will upload these whenever they need to.

My problem, C5 stores each file upload to different locations (files/1234/2345/cars.csv)

Is there a way that i can either chnage the file manager so it doesnt store files in a new loaction each time?
or
have the csv displayer point to a file without using the file manager
Thanks

 
TheRealSean replied on at Permalink Reply
TheRealSean
If you use the file manager then you refer to these with file IDs rather then file paths.
Are you uploading using the file library?
http://www.concrete5.org/documentation/developers/files/importers...

Failing that I once had a client that wanted something similar I used a hardcoded link and had them replace the files through FTP which I had provided access to within a csv folder.
gwp1971 replied on at Permalink Reply
Thanks for quick reply :)

Im not using filemanager as i presumed it would just put each file (every time its uploaded into a new sub folder)
Im using a simple php file upload script.

I like your idea of replacing the files through ftp, but i need all 4 files in the same folder, and the c5 filemanager creates new folders for each of the 4 files.

I suppose i could go into the database and chnage the link to the file, but i imagine the csv displayer would then not work, (unless i chnage the fliename BEFORE i add it to the csv displayer block ?
gwp1971 replied on at Permalink Reply
Ok, i have found a way around this.

1. upload file via filemanager. (mine was cars.csv) and add the file to the block as normal. Important, you must do this first.
2. go into your database (phpmyadmin) and look inside "fileversions"
3. look for the file you want (cars.csv)
4. you will see a field called "fvFprefix"
5. it will be populated with a series of numbers (123498764567)
this is the folder names files/1234/9876/4567/cars.csv
6. remove the numbers so the field is blank.
7. save
8. back to file manager, find the file and view its properties. you should see the URL to file as mysite.com/files/1234/9876/4567/cars.csv
9. hit the rescan button and you should then see the updated URL as
mysite.com/files/cars.csv
10. now you can use this file with your block.
11. Now you have to upload the file to the /files folder.

When you come to replace the file, either using upload script to overwrite, or ftp.

I hope this helps any others wanting to do the same.