• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

New storage type - Local folder

Wink

Chevereto Member
How can I upload images to local folder in same server and use subdomain for them without FTP?
Maybe we need something like this?

storage.png
 
Last edited:
Hi @Wink

This is something not hard to add, but the main concern that bugs me is why? You can configure the local images folder, so it can be /images, /i, /src, etc. So the thing is that I can't understand is why someone will need this.
 
why someone will need this.
I only have one possible reason is if you want to use one address to upload and one address to host all in the same server. :/ but it seems kind of rare that this would occur. If you run a forum for cats... catforum.tld then use catforumuploads.tld for uploading pictures, but it just puts it into a folder on images.catforum.tld
 
If we use subdomains, we can simple migrate from one type of external storage to another without changing images URLs. But we can't do it if our images placed inside /images or /srs or other.
Now I use site.com for chevereto script on my own server, and static.site.com as external storage on other hosting via FTP. And if I need to move static.site.com to my own server how can I do it?

And, of course, for security reasons we can completely disable PHP for static.site.com.
 
Last edited:
+1 for different url for image uploads.

I want to host my site on a SSD server, while want to move images to a cheaper HDD server. Hope this feature will allow this.
 
For any external thing the best thing to do is to use SFTP. For local stuff, I really don't see the point of having several local folders where images will be placed.

If you use external storage and lets say you want to migrate that to your main server you only need to move the files to your main server under any giving subdomain and point the CNAME there, then you just disable that external storage so no more images will be uploaded but the old images will be accesible.

That said, I still don't see utility of this.
 
If you're OK with SQL, just move the images to a the new storage, or, if you are looking to consolidate, merge the images on the external storage with the images in the current storage, ensuring you keep the file structure the same and then run an SQL query in whatever panel you use to change the value of the storage to the one you are going to use for those images.

So if you're moving everything from an FTP storage that has a storage ID of [whatever], update the chv_images table to reflect your change, so something like ....

UPDATE chv_images SET image_storage_id= [where they are going] WHERE image_storage_id= [where they are now]

If just moving them back to the origianl server, if you've decided not to use an external anymore, the value of the current new storage will be NULL

UPDATE chv_images SET image_storage_id= NULL WHERE image_storage_id= [where they are now]

Remembering to backup your db first, just in case.

I trialed it from a swift stack back to the hosting server and consolidated two external FTP's using this method, to test the theory.

@Rodolfo may shout a reason why this isn't a good way to do it (hopefully, then I'll learn a better way to do it as well), however, it worked successfully for my trials. If Rodolfo can't see any theoretical problem with that I'm going to write a PHP script to automate the move so I can swap and move storage as I want/need to.
 
You don't need any php code. External storage are just pointers so if you want to get rid of an external storage just disable it then change the cname to point your server.

Easy as a cname.domain.com points to localserver where cname is pointed as a subdomain in your server.
 
@Rodolfo

Sorry, mixed purpose message. The PHP script would physically move the files, i.e. "move all files from storage B to storage A". I was thinking if there was a script doing the file moving, then there may as well be a function to update the storage ID at the same time.

It's one of those things that either will never, or forever have a meaning on a site. If you had a huge site and used 20-30 FTP servers for external storage (OK, I've taken that to extremes), it may be nice to be able to move things around at will, without manually moving files and cnames.

I agree with you, for a single move it is easier just to copy the files and update the DNS records.
 
I think that the best way to do it is using rsync which is way faster than any PHP script. For those who don't have rsync or SSH access a PHP FTP 2 FTP should do the trick but it will be extremely slow for large folders.
 
The PHP was meant as a management tool if there were lots of FTP servers. I wouldn't use PHP FTP to do anything. The actual file "moving around" would be done by rsyc, initiated by a command from the management tool, rather than using it.

Like I said, only really applies to large sites with lots of different storages to facilitate "on the fly" moving around of files between servers.

Perhaps I just like tinkering too much :/
 
Back
Top