groupdocs-annotation / GroupDocs.Annotation-for-Java

GroupDocs.Annotation for Java examples, plugins, and showcase
https://products.groupdocs.com/annotation/java
MIT License
3 stars 4 forks source link

Downloading is not working #44

Closed atirtahirgroupdocs closed 3 years ago

atirtahirgroupdocs commented 3 years ago

This issue is raised in https://forum.groupdocs.app/t/download-annotated-is-not-working/8896

In the Angular project, in the annotation.service.ts we have the following snippet of code:

getDownloadUrl(credentials: FileCredentials) {
    return this._config.getAnnotationApiEndpoint() + Api.DOWNLOAD_ANNOTATED + '/?path=' + credentials.guid;
}

This method calls a GET /downloadAnnotated?path=C:\exemple-file.docx There are two problems, first the backslash cannot be used in browser URL, the second is this service is mapped differently in the backend, it is mapped as a POST method and the contract is different. See the file.

@RequestMapping(method = RequestMethod.POST, value = "/downloadAnnotated", consumes = APPLICATION_JSON_VALUE)
public void downloadAnnotated(@RequestBody AnnotateDocumentRequest annotateDocumentRequest, HttpServletResponse response) {
  ...
}
Pavel-Teplitsky commented 3 years ago

Hi Atir,

Thank you for your request. I have checked this issue but unfortunately I can't reproduce it. I have followed these steps:

  1. Clone the repo ,or you can download it.

  2. Set license path in the configuration.yml if you have.

  3. Go to the Demos\Spring folder

  4. Open console and run mvn clean spring-boot:run image

  5. When app in started open http://localhost:8080/annotation in you browser.

  6. All works well.

If you faced with this issue after following my steps - please share additional info:

  1. Browser.
  2. Your OS
  3. Issue screencast

Best regards.

mcqueide commented 3 years ago

Hi Atir,

Thank you for your request. I have checked this issue but unfortunately I can't reproduce it. I have followed these steps:

  1. Clone the repo ,or you can download it.
  2. Set license path in the configuration.yml if you have.
  3. Go to the Demos\Spring folder
  4. Open console and run mvn clean spring-boot:run image
  5. When app in started open http://localhost:8080/annotation in you browser.
  6. All works well.

If you faced with this issue after following my steps - please share additional info:

  1. Browser.
  2. Your OS
  3. Issue screencast

Best regards.

Hello Pavel,

I have just tested this again following all the steps that you have suggested, and the problem still happens. When I click on the download button I get a 405 HTTP error. Just the backslash was fixed after Vladimir commit b7341bd8, this is the revision that I have checkout.

Additional info: Browser: Google Chrome Version 92.0.4515.159 (Official Build) (64-bit) OS: Windows 10 Screenshot: image Git revision: b7341bd8

vladimir-litvinchik commented 3 years ago

@mcqueide

Please try the latest version.

mcqueide commented 3 years ago

@vladimir-litvinchik

Thanks for your help, I updated the project, I made a test and the download button is working.