Welcome Guest, Not a member yet? Register   Sign In
File upload verification
#2

Hi GotExx,

I run your code and it works fine for me.

If you get error message saying "Archive file is not a valid uploaded file." it means uploaded[archiveFile] validation fails. It has nothing to do with MIME types, as then it would tell you "Archive file does not have a valid mime type". 

You can check it yourself if you first remove uploaded[archiveFile] validation from your code and run it - it should pass OK. Then change mime_in[archiveFile,application/x-gzip] into mime_in[archiveFile,application/anything] and you will see "Archive file does not have a valid mime type". error message.

So you have to analyze why uploaded[archiveFile] validation fails. This validation rule calls isValid() function that will fail if anything from the following list occurs (as per official docs, https://codeigniter4.github.io/userguide...ht=isvalid):
  • The file exceeds your upload_max_filesize ini directive.
  • The file exceeds the upload limit defined in your form.
  • The file was only partially uploaded.
  • No file was uploaded.
  • The file could not be written on disk.
  • File could not be uploaded: missing temporary directory.
  • File upload was stopped by a PHP extension.
Many default settings limit max filesize to 10MB, and as you are dealing with archive file you might upload really large files. Try to upload smaller file, probably it will work. Othrwise check if your webserver allows you to upload files at all.
Reply


Messages In This Thread
File upload verification - by GotExx - 02-25-2020, 10:05 AM
RE: File upload verification - by zahhar - 02-25-2020, 11:26 AM
RE: File upload verification - by mdahmke - 06-15-2023, 06:03 AM
RE: File upload verification - by GotExx - 02-26-2020, 04:14 AM
RE: File upload verification - by zahhar - 02-26-2020, 08:04 AM
RE: File upload verification - by 12idho - 09-01-2021, 04:44 PM
RE: File upload verification - by InsiteFX - 09-02-2021, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB