Good Morning,
From my web application I upload images to the hosting and and then view them correctly from the web, but when I go to the file manager or FTP client, a lot of folders are empty. However files are there because trhough the web I can see them.
My problem is, I need to make a complete backup of my files/folders and I can´t get all of them, so I can´t make a backup… how is this possible??
Thank you
Can you please provide some more detailed information? What’s your site’s URL?
As long as you’ve navigated to the right folder on FTP it should show all the files that are in there.
I have however found that the online file manager doesn’t always show all files correctly (I think its a caching issue myself)
Its also possible that if a file has been deleted, but you’d visited the page previously, that the page is cached.
If you think the file might have been deleted its worth reading:
Are you using a CMS (such as wordpress) that might be creating some empty folders?
Hello,
The files are there, I can access all of them from my web application. I have an images folder with 1000 subfolders numbered from 1 to 1000 and some images inside of each one. If I go to my web I can see all of them, there is no caching issue, I can see it from any browser in any device… but with FTP client, or the file browser in the control panel I only can view some of them. It seems that only can view the first hundred of files inside folders more or less.
The files are there for sure.
Any idea?
How many files are you able to see? Is it 1000?
Because the FTP server has a limit that it will only return 1000 items with a directory listing. It’s a performance restriction, you can already see the file manager struggling quite a bit if you view a directory with 1000 files.
If so, then the files are there, you just can’t see them this way.
To avoid this, I would suggest considering to organize the files in directories so you stay within that 1000 items per directory limit.
I don´t know exactly how much files I can see.
My folder structure is something like this:
- htdocs
- images
- 001
- 002
- 003
- 004
- …
- 1000
- images
Inside of each numbered subfolder I have some images, only 3-5 in each one.
If I go with FTP client, and I go to subfolder 001, I can see the files. I go to the subfolder 100 and I can see them also… but If I go to the 150 I can´t see anything inside the folder, and any upper folder from there I can´t see any files inside the folders…
However the files are there, because If I go to my web app that points to these files I can see all of them, and in the link of each file, it refeers to that numbered folder.
I need to make a backup of all folders, but I have no way to do because of this problem
That’s odd. And just to confirm you said it was the same with the online file manager and an FTP client like FileZilla?
Yes, exactly the same behavior from FTP Client (Filezilla) and the online file manager.
I checked your account and I think I found the issue: file permissions.
As you can see in the file manager, the earliest directories have the permissions drwxr-xr-x
. But many of the newer one have the permissions d-wxrw--wx
. In addition to these permissions being unusual, I think they are preventing the listing of files in those directories.
To be able to access these directories again, you may need to update the permissions, or recreate them.
I’m frankly surprised you were able to do this because most features related to changing file permissions are blocked on our hosting precisely for this reason: incorrectly using them can lock you out of your own files. And there is just not a lot of benefit in not using the default permissions.
I really don’t know how I could do it.
Is there any way to restore all the default permissions without going one by one?
Or maybe could you restore defautl permissions for all my folders inside htdocs?
WARNING: Attempt this at your own risk and please make sure you have a backup of your site before even thinking about this
In filezilla its possible but you will have to be very very careful not to make a mistake
Right click on your htdocs and choose File Attributes (permissions)
Set the permissions numeric value to 755 (default)
Tick recurse into subdirectories
Tick Apply to directories only
Cross your fingers and click OK
Please double check everything because if you mess this up then say goodbye to your hosting !
Hello,
I tryed but I received an error that:
550 Could not change perms on folder: Permission denied
So I think I can´t change them. Maybe an admin from a console with root privileges in the server could do it??
Thank you so much.
Oh that is bad news, I’m not even sure if Admin will be able to fix it ?
Worst case will be that you’ll have to start again from scratch with a new domain but lets see what Admin says first
The problem is that all my data are there, I need to be able to make a backup of this at least.
Please, any updates on this?
Once there is an update you’ll know. But its likely that not even admin will be able to help at this point… IFastNet might be able to, since they are the ones who run the actual server. but I’m not sure if\how you could raise that with them?
I’m guessing you’ve tried downloading the whole of your htdocs folder and thats not pulled the files you can’t see either?
Exactly, I can´t download those files because none FTP client can access them.
The problem is important because I need to have a backup, and actually I can´t do it.
shucks. I just wondered because I’ve had issues with filezilla before where I can’t see files, but if i download the parent directory, it downloaded the files, and i could then update their permissions that way… I was hoping you’d see the same…
And i’m guessing you don’t have the files anywhere else you could pull together?
I don’t know if this will work (or is even active on infinity free), but PHP has a Chmod function, that can change file permissions… Here’s a little script that will run it on all files within the current directory:
<?php
// Get all files in the current directory
$files = scandir(__DIR__);
// Iterate through each file
foreach ($files as $file) {
// Exclude the current (.) and parent (..) directory entries
if ($file !== '.' && $file !== '..') {
// Ensure it's a file (not a directory)
if (is_file($file)) {
// Update file permissions to 0755
if (chmod($file, 0755)) {
echo "Permissions for $file updated to 0755 successfully.<br>";
} else {
echo "Failed to update permissions for $file.<br>";
}
}
}
}
?>
Might be worth trying that on one of the directories and seing if it fixes the problem?
I’ve asked staff to fix the file permissions for you. It should be good now!
Thank you so much!! I have been able to make a backup!