Apache can't display some images in same folder - php

I have more than 4500 images uploaded in the same folder. I'm uploading images with a php script. It was working fine but today i can't see images on web browser.
I can see a.jpg but i can't see b.jpg. All files have same size (3MB), same type (jpeg) and same access (644).
I tried to download the image to my disk with FTP. I can see on my mac. But i can't see on web browser.

Related

Upload specific file types to another server (wordpress)

Imagine there are 2 servers:
Server1 is the server that my WordPress website is currently hosted.
Server2 is my download server where I upload big files in it for my users to download.
Now I want when I am uploading files with the format "mp4" in WordPress media, it uploads my file to server2. Otherwise, every file format except mp4 to be uploaded on server1 (main WordPress upload directory).
Is there any way to do this? Thank is advance!

Working .mp4 video file after a while get corrupted

Usually i upload video files on my server (no problem in upload or with audio/video codec or container) and all of a sudden after a random time some files get corrupted and act like the one at that link http://www.animestream.it/e2737-Dakara_Boku_wa,_H_ga_Dekinai-01 (http://www.animestream.it/anime/dakarab/DakaraB_Ep_01.mp4)
This video and all the ones in the same folder act like this, but older videos (even videos that has been on the same server for 2 years) not having this problem.
I have already checked this things
File permissions (R-X)
Downloaded file to check if working and it does, perfectly.
Is not a problem of the client/browser since this file worked till yesterday

Thumbnail is not generated while uploading a video which is downloaded from the same server

I am using drupal 7 video module and ffmpeg together to upload video on my site.
My problem:
Upload a video, everything works fine, thumbnail is generated and video is uploaded successfully
Now download the above uploaded video.
Now Try to upload the same video, on same drupal site.
Thumbnail is not generating and also I am not able to play the newly uploaded video.
In all other cases video upload is working fine, I am able to upload same video again and again with no fuss,but when I try to upload the downloaded video , everything goes wrong even if I change the file name after downloading the video and uploading again.
Please let me know if I am not clear, will try to explain more.
I would suggest you take a look at the ffmpeg log/console output when you try to re-upload a previously downloaded file. There could be something wrong while the file is re-processed.
If you need more help please provide the output of the ffmpeg console of the video and a sample file that is not working with encoding/processing settings.

Permission denied after image upload

I've got a image upload script that works on my Apache on IIS development server, but on the Apache Lunix live server, although the images are uploaded correctly and the MySQL database is updated correctly, I can't view the images.
Viewing the HTML source, checking both the FTP files and the database values, all look OK.
But the image doesn't show, just the white box with the red cross in the corner.
If I try to copy the shortcut of the image and open it in a separate window, I get the following:
I'm not sure what to try next, it seems strange that the files/database/source look good but it just won't show!
I've tried both $HTTP_POST_FILES and $_FILES to upload the images, but both have the same result.
Change the File Permission for images you are uploading, You Apache Server doesn't have permissions to read the image file.
So usually people have Apache Server run as a particular user, which has read (may be write ) access to such content

Image file permission - image resizer

PHP
mySQL
Hi, i am having an interesting problem.
I have a form in my cms that allows the admin to upload images to the server. The script resizes the images to a thumbnail (170px height)and a large image(600px height). The thumbnails are around 16000k in size and the large images are around 160,000k in size.
I do not set file permissions and just let it happen automatically.
When i go to the site i can see the thumbnails but i can't see the full size images and i have tracked the problem down to the file permissions. The thumbnails have rw-r-r permissions and the larger images have rw-- -- -- permissions. Ie the public does not have permission to view the large images. I save the large images with the name of the original and i save the thumbnails with _thumbnail appended to the end.
Why would the permissions of the large images be different when they are both uploaded and resized by the same script and when i do not set file permissions? Does the size have something to do with it? I only get this problem when uploading images to the production server, not when working on my local machine.
Thanks
Andrew
How are you resizing the images? Are you using an external program?
This is just a guess, but here goes
admin uploads image.jpg via your form
php script writes uploaded image.jpg to file system as rw- --- --- (600)
php script calls image resizer program to create image_thumbnail.jpg
image resizer writes image_thumbnail.jpg as rw- r-- r-- (644)
php script calls image resizer program to create resized image.jpg
image resizer overwrites image.jpg, but leaves permissions as rw- --- --- (600)
To test this theory, comment out the part where it resizes image.jpg to 600px, and then check the permissions of the originally uploaded image. If they are 600, then there's your problem.
Regardless though, a simple chmod will solve your problem.
I will suggest you to first look at your php.ini file
;Maximum allowed size for uploaded files.
upload_max_filesize = 10M
;Maximum size of POST data that PHP will accept.
post_max_size = 10M
The default settings would be 2M. You will need to change it like I mentioned here. If its still not working please get back.

Categories