Skip to content

Instantly share code, notes, and snippets.

View nqphuong's full-sized avatar

Nguyen Quoc Phuong nqphuong

View GitHub Profile
//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.
<?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
@nqphuong
nqphuong / readfile_chunked.php
Last active October 1, 2015 12:26
test gist code snippet
<?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.