What is the reason behind for such file upload failure? |
Hi gentle guys I will try my best to explain; I would like to know what is the cause of this error? when I put the CI app on the live Apache Server and start uploading files of more than 2MB it loads and then runs to this 403 error but less than 1MB upload fine
I want to be clear here as follows: If I use less than 800kb file size it works fine but if I use more than 1.5 + MB image file it runs on this error 403 honestly, I would not like to talk about another PHP framework here but in this scenario, I may ask you to explain on what I know of this If I do it with Laravel it works fine even for 3MB image files and also for CakePHP work fine so what cause for CI 4? but in AJAX work fine (Nb: excluded AJAX here) but by using reload runs to 403 server error so What is the main cause??!! Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
Nobody except you can see your screen and your code, your server configurations.
So it is difficult to guess what's wrong. If your site works on local but does not work on the live server, the server configurations (Web server/ PHP on server) is the cause. It seems liteSpeed shows the error. The request may not have reached CI4.
Thank you @kenjis My issue is that generally the APP work fine except when I upload an image file of more than 2MB fails and run on 403 error and this has been my curious inspection a search that is why have compromised between the three categories above The App work fine in Ajax for more than 2MB image file uploading. My asking was why if I use non-Ajax post it runs on this 403 error but less than 1Mb image fie uploading works fine?
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
Have you checked your php,ini settings for that? Sounds like maybe a post_max_size setting is restricting it. I believe 2MB is typically the default for PHP installations.
@kilishan and @kenjis if this was an issue ( post_max_size) but also if I use pure AJAX it works fine with the same settings except for no AJAX function also I do not know why other frameworks work with the same settings? any way Thank you all
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
If it is because of post_max_size, Ajax request or other frameworks should not work.
Without knowing if the other frameworks are on the same server, running on the same PHP version there's no way to tell. I wouldn't think they'd override ini settings by default but it's possible.
Is your AJAX method POST or PUT? There's also upload_max_filesize that could come into play.
Thank you so much @kenjis I think you are right but it looks like something magic, but also in the local server works fine The App it is working except for more than 1.5 to +++ it fails and runs on 403 error that is why have been curious searching and from testing with different tries (I use Put/Post (methods)- or (resource - route) for AJAX it works fine) out of AJAX it runs away to 403 error.
so for the AJAX function, it does fine and because I use a lot of ajax, recently, I have made a change to a non-AJAX app and now is where I encountered such a phenomenon issue. by the way now if I use between these two ways works fine: Code: #ini.php @kilishan as you say it is possible for others as also someone glimpsed me that (I don't want to talk much of others here) Laravel overwrites this in their uploading file system so far by those two ways above helped me to solve. thank you all gentle guys for your time regarding my issue once again Thank @kanjis & @kilishan Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
|
Welcome Guest, Not a member yet? Register Sign In |