This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create dropzone instance with some attributes | |
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone | |
url: siteurl// Url to process images uploaded. | |
thumbnailWidth: 80, | |
thumbnailHeight: 80, | |
parallelUploads: 20, | |
previewTemplate: previewTemplate, | |
autoQueue: true, // Queue all files selected. It need to upload image. | |
previewsContainer: "#previews", // Define the container to display the previews. | |
clickable: ".fileinput-button", // Define the element that should be used as click trigger to select files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
$root: Path to your file | |
$filename: Name of file to read | |
$ext: Your file extension | |
*/ | |
private function download_big_text_file ($root, $filename, $ext) { | |
//Max file size | |
$max_file_size = 10*1024*1024; | |
//Calculate file size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function readfile_chunked($root, $filename){ | |
$handle = fopen($root.$filename, 'rb'); | |
if($handle === false){ | |
return false; | |
} | |
// How many bytes per chunk. | |
// At each time, the server will read and send the data to client site chunk by chunk. | |
// It helps us to save memory usage. |