Target file unreadeble

Abdullah Safdar Ali 1 Reputation point
2021-07-08T07:30:24.26+00:00

Hello,

I created a translator resource and blob container for translator. Using storage explorer I uploaded a document in source blob.
112913-image.png. After that I created SAS signatures and sent this request in the body from postman:

   {  
       "inputs": [  
           {  
               "storageType": "file",  
               "source": {  
                   "sourceUrl": "https://resourcename.blob.core.windows.net/source/sourcefile.pdf?sv=2020-04-08&st=2021-07-07&se=2021-07-08T23&sr=b&sp=r&sig="  
               },  
               "language": "en",  
               "targets": [  
                   {     
                       "targetUrl": "https://resourcename.blob.core.windows.net/target/translationresult.docx?sv=2020-04-08&st=2021-07-07T23&se=2021-07-&sr=c&sp=wl&sig=  
                       "language": "ar"  
                   }  
               ]  
           }  
       ]  
   }  

Source SAS is of the file and target SAS is of container as written in the docs. The result I get in result blob:

112932-image.png
As shown it is 0 bytes and content-type is octet-stream. For 1 file I changed it to openxml and the size of the file was increased but I still am unable to open it.
112790-image.png.

Let me know what can I do.

Regards

Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
240 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,578 questions
Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
363 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,656 Reputation points Microsoft Employee
    2021-07-09T07:03:37.58+00:00

    @Abdullah Safdar Ali I was able to replicate your issue, The reason you see that error is because you are using your target file format as .docx instead of .pdf
    The translator preserves the format of the document and you need to use the same format for your target file. In the files that you have already translated you can view them with a PDF viewer and it should open without any errors. I hope this helps, please feel free to accept the same as answer if it helped.

    Error if I open the .docx translated file with word
    113188-image.png

    Same doc with a PDF viewer
    113130-image.png