KevinTheJedi in class.file.php there is function download which is used to serv the file loaded from provider, internally calls headers() (to set appropriate headers mime type, content length etc.) getContetn() function which gets content of file. if i just dump contents of file i get content of file if headers are added content is present to browser as image which is invalid for some reason. so either problem lies in headers => no error logs on server site || on site of browser unsupported mime type when used in inline image or something.
Images Suddenly Stopped Displaying
- Edited
This is where the majority of the file download headers actually get set:
Each GET for /file.php should have those headers present to tell the browser how to handle the attachment.
Cheers.
- Edited
KevinTheJedi Yes i now, this was my debug how to test if there are maybe some issues with permissions or paths, i would not get any content if they would be there Right ?
But i get the content then problem must be related with browser or headers, but don't know how to try to get more detail problem why headers/browser is not correctly read.
is there any possible path how to get Absolut path to attachment file ? (inside file below)
if yes i can try to use my different image serv function i am using in different app based on PHP which is running in same environment correctly. similar to code below
$imageFolder = realpath($imageFolder);
$imageFile = $imageFolder . $vin . '-' . $i . '.jpg';
header('Content-Type: ' . mime_content_type($imageFile));
header('Content-Length: ' . filesize($imageFile));
readfile($imageFile);
exit;
- Edited
No, you send the key and other needed information to the file.php where it looks up the file, gets the content, etc. and serves it back to the browser. Only other way would be to get the file yourself from db or from the file system.
Edit:
I think you meant from the file system. If that’s the case then of course. The files are all there by key.
Cheers.
KevinTheJedi shi*** then we are totally scrued , i don't know hat to text next or how to verify that content which is returned to browser is actually an image. If i can get you any more information's let me know i would be sad if we would need to switch off from OST it served us well for many years so far :/ and we were supper happy with it
Read my edit above. Files on filesystem are accesible directly on the server by key.
Cheers.
- Edited
KevinTheJedi they are in some random subfolders :/ how can i guess name of subfolder ?
gamerclassn7 first letter of key
KevinTheJedi i maybe found our issue, if i parse key as you specified files are not there, if i find them manually by date of creation and time they are there under different key. at least 4 which I tried to found
I'm sorry but that doesn't really make much sense. The file keys and file names on filesystem do not change after they are created. Let's say for example have a link like /file.php?key=fzadgagadsfadfads&expires=...
. The file key in this case would be fzadgagadsfadfads
which means on the filesystem there will be a file named fzadgagadsfadfads
in the f/
directory in your attachment folder. Keep in mind that IIS is case sensitive with the folder names and file names.
Cheers.
- Edited
KevinTheJedi yes that is precisely what i mean, for example i have key
but the image is stored
can be found inside directory with name 'c' which is in diffrent path for IIS right ?
I don’t understand what you are asking. What is shown in your screenshot should be the full path to the file. It’s essentially the full path to the attachment folder + the folder name (first character of key) + file key. You can find the path to the attachment folder from within the plugin settings.
Cheers.
KevinTheJedi sorry, i will try to make it clear attachment is not in same path which is resolved from database instead of big C in folder name there is small c on filesystem could this be the problem ?
It all depends on what the key from the db is and the IIS setup. Not all setups are the same so yours could very well not be case sensitive. I just know the majority of IIS setups that I’ve dealt with are. Anyways, the key from the db is always the correct casing. So whatever the first character of the key in the db is should be the folder it’s stored in.
Cheers.
KevinTheJedi Hi, I was able to get it working again by starting from scratch (even WM) initializing new server not just DB an reinstalling server how ever after 12 days same error appeared again.
Any idea what can be tried next ?
EDIT: Files can be accessed on File System and also in outgoing email and just not in WEB
KevinTheJedi this is not possible in our Sec Enviroment
Then without much more information or access to your system I cannot really further assist. I don’t have too much experience with windows servers so I’m not going to be of too much help unless I have access to your system (which I can’t do unless you go through our support services) or if you provide enough debug information.
Cheers.
KevinTheJedi As i stated i can provide what ever you want, but that is that is problem there is nothing in logs :/