- Timestamp:
- Apr 15, 2009, 12:49:04 AM (15 years ago)
- Location:
- branches/2.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/ws_functions.inc.php
r3192 r3239 924 924 ); 925 925 926 ws_logfile('[ws_images_add_chunk] data length : '.strlen($params['data'])); 927 926 928 $bytes_written = file_put_contents( 927 929 $upload_dir.'/'.$filename, 928 $params['data']930 base64_decode($params['data']) 929 931 ); 930 932 … … 959 961 960 962 sort($chunks); 963 964 ws_logfile('[merge_chunks] memory_get_usage before loading chunks: '.memory_get_usage()); 961 965 962 $string = null; 963 foreach ($chunks as $chunk) { 964 $string.= file_get_contents($chunk); 966 foreach ($chunks as $chunk) 967 { 968 $string = file_get_contents($chunk); 969 970 ws_logfile('[merge_chunks] memory_get_usage on chunk '.++$i.': '.memory_get_usage()); 971 972 if (!file_put_contents($output_filepath, $string, FILE_APPEND)) 973 { 974 return new PwgError(500, 'error while writting chunks for '.$output_filepath); 975 } 976 965 977 unlink($chunk); 966 978 } 967 if (!file_put_contents($output_filepath, base64_decode($string))) 968 { 969 return new PwgError(500, 'error while merging chunks for '.$output_filepath); 970 } 971 979 980 ws_logfile('[merge_chunks] memory_get_usage after loading chunks: '.memory_get_usage()); 972 981 } 973 982 -
branches/2.0/tools/piwigo_remote.pl
r3192 r3239 256 256 my %params = @_; 257 257 258 my $content = encode_base64(read_file($params{filepath}));258 my $content = read_file($params{filepath}); 259 259 my $content_length = length($content); 260 260 my $nb_chunks = ceil($content_length / $conf{chunk_size}); … … 274 274 { 275 275 method => 'pwg.images.addChunk', 276 data => $chunk,276 data => encode_base64($chunk), 277 277 original_sum => $params{original_sum}, 278 278 position => $chunk_id,
Note: See TracChangeset
for help on using the changeset viewer.