nepada / file-upload-control Goto Github PK
View Code? Open in Web Editor NEWFile upload control for Nette forms: multi-file AJAX upload via blueimp-file-upload, Bootstrap 4 and 5 template.
License: BSD 3-Clause "New" or "Revised" License
File upload control for Nette forms: multi-file AJAX upload via blueimp-file-upload, Bootstrap 4 and 5 template.
License: BSD 3-Clause "New" or "Revised" License
Is there a way to disable submit button until all uploads are finished or canceled?
If I submit form when the upload is still in progress it adds already uploaded files however large file that was still in progress of uploading finishes upload (based on Tracy AJAX requests) but then is lost.
Hi,
I implemented your component in my app and I am having issue which I don't know how to solve.
When I set a rule to limit allowed mimetypes and I try to upload larger file, it fails on first chunk because FileUpload does not have mimetype available. I don't know if I should report this in nette/forms or here. If it is fixed in nette/forms and the rule fails, the upload fails.
$form->addFileUpload('upload')
->addRule($form::MimeType, 'web.message.file-unknown-mimetype', $this::AllowedMimeTypes)
->addRule($this->checkFreeSpace(...), 'web.message.file-size-limit-reached')
->addRule($form::MaxFileSize, 'web.message.file-maximum-size', 5e7) // 50 MB
->addRule($form::MaxLength, 'web.message.file-maximum-number', 6);
The fail occurs in Validator.php in nette/forms because strtolower does not expect null.
public static function validateMimeType(Controls\UploadControl $control, $mimeType): bool
{
$mimeTypes = is_array($mimeType) ? $mimeType : explode(',', $mimeType);
foreach (static::toArray($control->getValue()) as $file) {
$type = strtolower($file->getContentType());
if (!in_array($type, $mimeTypes, true) && !in_array(preg_replace('#/.*#', '/*', $type), $mimeTypes, true)) {
return false;
}
}
return true;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.