mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-28 17:07:49 +00:00 
			
		
		
		
	Add OC-Total-Length to UploadRemoteFileOperation
This commit is contained in:
		
							parent
							
								
									8f068a2849
								
							
						
					
					
						commit
						aaebdefe56
					
				| @ -44,7 +44,6 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation | ||||
|      | ||||
|     public static final long CHUNK_SIZE = 1024000; | ||||
|     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(); | ||||
| 
 | ||||
|     public ChunkedUploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) { | ||||
|  | ||||
| @ -53,6 +53,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||
| 
 | ||||
| public class UploadRemoteFileOperation extends RemoteOperation { | ||||
| 
 | ||||
| 	protected static final String OC_TOTAL_LENGTH_HEADER = "OC-Total-Length"; | ||||
| 
 | ||||
| 	protected String mLocalPath; | ||||
| 	protected String mRemotePath; | ||||
| @ -116,6 +117,7 @@ public class UploadRemoteFileOperation extends RemoteOperation { | ||||
| 				((ProgressiveDataTransferer)mEntity) | ||||
|                         .addDatatransferProgressListeners(mDataTransferListeners); | ||||
| 			} | ||||
| 			mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(f.length())); | ||||
| 			mPutMethod.setRequestEntity(mEntity); | ||||
| 			status = client.executeMethod(mPutMethod); | ||||
| 			client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user