I recently purchased a PHP script for my website. The software is working very well except when I try to upload images or videos (built in function). After I upload an image using the website script, the result is "broken image" icon in place of the picture. When you try to click on the image, the resulting link is:
http ://www..com/thumbnail.php?pic=C:*Upload Source Directory* \07172364.largeThumb.b.jpg&w=100&sq=Y&b=Y
After doing some research, I found some articles that state the php.ini needs to dictate how the php script handles image uploads. Upon looking at my php.ini file, the only line is:
session.save_path = "/home/<directory>/public_html/tmp"
session.use_only_cookies = on
I cannot find any information on what lines of coding need to be in my php.ini file in order to handle file uploads.
My questions are:
1) Am I looking in the right direction for solving this problem?
2) Is there a standard script that should be included in my php.ini in order to handle file uploads.
Thank you.
Given this is video and not images, when you say both should be supported, perhaps it's a filesize issue. In that case you're in the right spot (php.ini) and looking to increase the upload size to a value greater than your intended video size:
upload_max_filesize = 10M
post_max_size = 20M
The solution to this issue was that my webhost did not have my account setup correctly to upload images. Once I contacted my webhost, the setting was corrected and my issue was resolved.
Related
I created a website using Codeigniter and mysql. There is a form for users where they upload their pictures. When I upload a picture to test it, it works fine. But sometimes, when someone else uploads a picture, it doesn't work. How can I know the actual problem?
There are many ways to debug a file upload issue. Most certain checks to implement in code are:
Filesize - If media file size is more than the defined size, It should throw some message to the user.
Extensions - Do list accepted extensions as a text message around file upload button. In the code, make sure, your code accepts those extensions.
Log errors and warnings - Enable log errors. You can easily debug the issue.
Make sure the directory where files will upload must have writable permissions.
On the webpage where the image will be displayed,it must have a proper path like https://www.DOMAINNAME.com/directoryName/fileName.extension
You can check in php.ini file for following directives:
upload_max_filesize & post_max_size
If there is low upload_max_filesize or post_max_size is set it will not upload files.
You can verify both values in using phpinfo(); method
I recently setup load balancing for my website wordpress blog 2 back-end nodes with HAproxy. Now i am facing a very strange issue. Images are uploading of 0 Bytes randomly.Some images are uploading fine and some are not.This issue happens when I upload post through window live writer.
When I retry 0 Bytes Images they uploaded successfully.
PHP Configuration
file_uploads = On
upload_max_filesize = 8M
max_file_uploads = 40
post_max_size = 8M
max_input_time = 60
Images uploaded through WP or Window Live writer uploaded to server then using lsyncd images sent to the image server.
I am not able to figure out the issue. Please help me to solve the issue.
Thanks
I would check following:
image uploaded on one server but being use on another (make sure your file processed within one request)
upload data time limit is too short
PS: could you be more specific in your question, describe software you are using, add you config. It will help to localize the issue.
I am developing a web application which will allow the administrator to upload a file and its max size is 500M.
I have changed the post_max_size = 500M and upload_max_filesize = 500M from 32M but the funny thing is that it does not allow me to upload files greater than 32M still.
I have restarted the server and everything and still cant get to upload a large file.
Is there any other setting i should change to allow me to upload the file?
I am not going to process the file in memory but move it to the tmp folder and than process from there with move_uploaded_file so memory_limit i am assuming that is not going to be affected.
It is a simple form and as i recall if the limit is exceeded in the $_FILES superglobal array i should see something in the error element of the array but instead i get an empty array.
EDIT: I am modifying the php.ini settings but from phpinfo i am still getting the sizes of 32MB. And the php error log says that obviously i am exceeding 32MB
Can you please help me out.
Thanks
Chech phpinfo() on a web page, see which php.ini is loaded. You could be editing the wrong file.
Sometimes different ini files get loaded for command line and apache server use
I fount out what the problem is:
I am using MAMP as a developing server and MAMP has templates which override the original every time the server starts (a stupid thing IMO) so you need to change the template for it to take effect!
The template can be found under /Applications/Mamp Pro/Contents/Resources
And there many php ini files for every version will be found.
Hope this helps to the next one!
I have form created by the admin generator in the backend of a website. It allows the upload of a video to the site.
It works fine but strangely, the upload fails for files of 10mb or over. However, I have not set any file limits in my form.
Are there Symfony/PHP/Apache/web browser settings regarding this type of behaviour that I can look into?
Or is there a way I can inform Symfony that I'd like to permit larger files?
Even I haven't ever worked with Symfony I expect the problem due to limitations on your Web-Server.
If you have the possibility to edit or add your .htaccess file then the following line of code will probably help you:
php_value upload_max_filesize 100M
the 100M in example is for 100 Megabyte.
Also make sure that (at a minimum) you update post_max_size to match. See the PHP documentation, especially the sections on "Common Pitfalls" and "Error Messages Explained".
I want to upload and store video files to my server using PHP. Could any one please provide me some example about how to upload a large file using PHP?
Please keep in mind that these files are generally larger than 200 MB.
I think the question is fairly limited, is it the post size where there are problems? Uploading files of this size, really should be handled by something else than the normal upload control. You should see if you can give the user a progress on the upload, because otherwise users probably will cancel the upload if it takes too long.
First hit on google: Google search
http://bluga.net/projects/uploadProgressMeter/
Look at this move_uploaded_file, but if it's so big, it needs to be allowed in php.ini to upload this big files. And maybe you will have problem with Apache as well, because default time when it disconnects you is 5 minutes.
You will need to edit PHP.INI and change those two parameters:
upload_max_filesize = 500M
post_max_size = 500M
...for a maximum upload filesize of 500MB.
If you have a properly set-up server you can put php.ini files into your htdocs root, and it will be effective.