Could someone please suggest how to upload local file saved in a network drive to Azure blob? I cannot use tfilefetch because of file is saved in the local drive and upload to Azure blob. It works in reverse. Fetching file from blob and dropping it to local drive. Tried TREST component and it only saves the header and not the file content. I am not able to make below code work that provided as a solution for TREST.
OkHttpClient client = new OkHttpClient();
File sourceFile = new File("C:drive/text.csv");
MediaType mediaType = MediaType.parse("multipart/form-data");
RequestBody body = new MultipartBody.Builder()
.addFormDataPart("file", "C:drive/text.csv",RequestBody.create(MediaType.parse("/csv"), sourceFile) )
Request request = new Request.Builder()
Response response = client.newCall(request).execute();
String json = response.body().string();
Is there an http web service put component that can be used to load csv file to an external location? We cannot use storageblob component for this solution.
Sorry for the late response. No, I cannot use tAzureStoragePut. I have to either use trestclient or trest. I tried trest and it only saves header. thttprequest works but now thrown error of 413 error code. It worked sometimes when files are smaller. I cannot use tfilefetch, it only works in reverse. I need to fetch a file from local drive and drop to Azure. Any suggestions?
Watch the recorded webinar!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.