Changeset 841
- Timestamp:
- Mar 27, 2015 11:36:13 AM (10 years ago)
- Location:
- pro-violet-viettel/www/deploy/20150304
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php
r831 r841 14 14 15 15 public function getFile () { 16 $file = $this->config->item('api_url').'uploads/space/3/3854/1.JPG'; 17 header('Content-Description: File Transfer'); 18 header('Content-Type: application/octet-stream'); 19 header('Content-Disposition: attachment; filename='.basename($file)); 20 header('Expires: 0'); 21 header('Cache-Control: must-revalidate'); 22 header('Pragma: public'); 23 header('Content-Length: ' . filesize($file)); 24 readfile($file); 16 $file= $this->input->post('file'); 17 $folder= $this->input->post('folder'); 18 $files = $this->vservices->actionExecute('getFiles',array("file"=>$file,"folder"=>$folder)); 19 echo "<pre>"; 20 print_r($files); 21 echo "</pre>"; 22 die(); 23 $file = file_get_contents($fileurl); 24 file_put_contents("1.jpg", $file); 25 $local_file="1.jpg"; 26 $download_rate = 512; 27 $download_file = $this->input->post('filename'); 28 29 // send headers 30 header('Cache-control: private'); 31 header('Content-Type: application/octet-stream'); 32 header('Content-Length: '.filesize($local_file)); 33 header('Content-Disposition: filename='.$download_file); 34 35 // flush content 36 flush(); 37 38 // open file stream 39 $file = fopen($local_file, "r"); 40 41 while (!feof($file)) { 42 43 // send the current file part to the browser 44 print fread($file, round($download_rate * 1024)); 45 46 // flush the content to the browser 47 flush(); 48 49 // sleep one second 50 sleep(1); 51 } 52 53 // close file stream 54 fclose($file); 55 25 56 exit; 26 57 -
pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php
r831 r841 11 11 <script type="text/javascript"> 12 12 $(".html5gallery").html5gallery(); 13 $( ".bootbox" ).addClass( "preview" ); 13 14 </script> -
pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/video.php
r816 r841 1 1 2 <div style="display:none;" class="html5gallery" data-skin="darkness" data-width="540" data-height="300">3 <a href="<?php echo $fileurl;?>"><img src="<?php echo $fileurl;?>" title="<?php echo $name;?>" alt="<?php echo $name;?>"></a>2 <div data-autoplayvideo="true" data-playvideoonclick="true" style="display:none;" class="html5gallery" data-skin="darkness" data-width="540" data-height="300"> 3 <a href="<?php echo $fileurl;?>"><img src="<?php echo $fileurl;?>" title="<?php echo $name;?>" alt="<?php echo $name;?>"></a> 4 4 5 5 </div> 6 6 <script type="text/javascript"> 7 $(".html5gallery").html5gallery(); 7 $(".html5gallery").html5gallery(); 8 $( ".bootbox" ).addClass( "preview" ); 8 9 </script> -
pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
r840 r841 317 317 var btnDownloadClick = function () { 318 318 var items = o.oGrid.getHightLightItem(); 319 320 window.location.href = o.host+"download/getFile/"+items[0].id; 319 var fileid= new Array(); 320 var folder= new Array(); 321 for (var i = 0; i < $(items).length; i++) { 322 if(items[i].type=="file") 323 { 324 var file = items[i].id; 325 fileid.push(file); 326 } 327 if(items[i].type=="directory") 328 { 329 var file = items[i].id; 330 folder.push(file); 331 } 332 } 333 console.log(fileid.toString()); 334 var redirect = o.host+"download/getFile/"; 335 $.redirectPost(redirect, {file: fileid.toString(),folder: folder.toString()}); 321 336 } 322 337 … … 522 537 if($.inArray( $ext, ["ppt","xls","doc","pdf","docx","pptx","xlsx"])>=0) 523 538 { 524 539 525 540 $.ajax({ 526 541 url: o.host+"preview/getFilePreview/"+node.id, … … 540 555 if($.inArray( $ext, [ "xvl"])>=0) 541 556 { 542 var redirect = o.host + 'frontend/lecture/'; 557 var url = o.host.replace("ajax/", ""); 558 var redirect = url + 'frontend/lecture/'; 543 559 self.redirectPost(redirect, {fileid: node.id}); 544 560 } 545 546 561 $( ".bootbox" ).addClass( "preview" ); 547 562 } 548 563 … … 1011 1026 } 1012 1027 1013 1028 this.formatFileSize = function (size) { 1014 1029 var i; 1015 1030 i = Math.floor(Math.log(size) / Math.log(1024)); … … 1021 1036 } else { 1022 1037 return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][i]; 1023 } 1024 }1038 }} 1039 1025 1040 1026 1041 this.initialize = function () { … … 1031 1046 return this.initialize(); 1032 1047 } 1048 1033 1049 }); 1034 1050 })(jQuery);
Note: See TracChangeset
for help on using the changeset viewer.