mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-30 18:07:38 +00:00 
			
		
		
		
	Add OC-Total-Length header to ChunkedUploadRemoteFileOperation
This commit is contained in:
		
							parent
							
								
									2b2fc9171f
								
							
						
					
					
						commit
						8f068a2849
					
				| @ -44,6 +44,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation | |||||||
|      |      | ||||||
|     public static final long CHUNK_SIZE = 1024000; |     public static final long CHUNK_SIZE = 1024000; | ||||||
|     private static final String OC_CHUNKED_HEADER = "OC-Chunked"; |     private static final String OC_CHUNKED_HEADER = "OC-Chunked"; | ||||||
|  |     private static final String OC_TOTAL_LENGTH_HEADER = "OC-Total-Length"; | ||||||
|     private static final String TAG = ChunkedUploadRemoteFileOperation.class.getSimpleName(); |     private static final String TAG = ChunkedUploadRemoteFileOperation.class.getSimpleName(); | ||||||
| 
 | 
 | ||||||
|     public ChunkedUploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) { |     public ChunkedUploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) { | ||||||
| @ -75,7 +76,8 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation | |||||||
|                 } |                 } | ||||||
|                 mPutMethod = new PutMethod(uriPrefix + chunkCount + "-" + chunkIndex); |                 mPutMethod = new PutMethod(uriPrefix + chunkCount + "-" + chunkIndex); | ||||||
|                 mPutMethod.addRequestHeader(OC_CHUNKED_HEADER, OC_CHUNKED_HEADER); |                 mPutMethod.addRequestHeader(OC_CHUNKED_HEADER, OC_CHUNKED_HEADER); | ||||||
|                 ((ChunkFromFileChannelRequestEntity)mEntity).setOffset(offset); |                 mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(file.length())); | ||||||
|  |                 ((ChunkFromFileChannelRequestEntity) mEntity).setOffset(offset); | ||||||
|                 mPutMethod.setRequestEntity(mEntity); |                 mPutMethod.setRequestEntity(mEntity); | ||||||
|                 status = client.executeMethod(mPutMethod); |                 status = client.executeMethod(mPutMethod); | ||||||
|                 client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); |                 client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user