Comments (2)
If you want to allow all mime types, do not set any allowed mime types in the mimes array. The callback that checks for mimes only validate if the array is not empty.
You can proceed in this way to upload a file allowing all mime types but with file size validation:
if (!empty($_FILES['test'])) {
$upload = Upload::factory('important/files');
$upload->file($_FILES['test']);
//set max. file size (in mb)
$upload->set_max_file_size(1);
$results = $upload->upload();
var_dump($results);
}
from php-file-upload-class.
Hm, got it! Thanks 👍
from php-file-upload-class.
Related Issues (18)
- error in uload class HOT 2
- Suggest to add is_uploaded_file() check. HOT 2
- Fatal error: Class 'finfo' not found HOT 2
- hint: refactor using camelCase HOT 1
- Extra parameter on function Upload::upload HOT 1
- problem with upload array of file HOT 2
- upload two file in separate destination HOT 2
- resize to custom size HOT 1
- Please use more descriptive notes on updates
- viewing the pdf file with the new encrypted filename - Failed to load PDF document.
- .
- Multiple uploads on same page error HOT 1
- $root param method is not used in factory HOT 1
- erro in create_destionation dir already exists HOT 1
- save_file() error HOT 1
- Uploaded file no extention HOT 2
- is_writable returning NULL / false after set_destination HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-file-upload-class.