mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-18 05:02:15 +01:00
fix(api): handle correctly filename that takes more that 200 bytes
This commit is contained in:
@@ -420,7 +420,8 @@ func convertRoute(libreOffice libreofficeapi.Uno, engine gotenberg.PdfEngine) ap
|
||||
// document.docx -> document.docx.pdf, so that split naming
|
||||
// document.docx_0.pdf, etc.
|
||||
for i, inputPath := range inputPaths {
|
||||
outputPath := fmt.Sprintf("%s.pdf", inputPath)
|
||||
originalName := ctx.OriginalFilename(inputPath)
|
||||
outputPath := ctx.GeneratePathFromFilename(originalName + ".pdf")
|
||||
|
||||
err = ctx.Rename(outputPaths[i], outputPath)
|
||||
if err != nil {
|
||||
@@ -502,7 +503,8 @@ func convertRoute(libreOffice libreofficeapi.Uno, engine gotenberg.PdfEngine) ap
|
||||
if len(outputPaths) > 1 && splitMode == zeroValuedSplitMode {
|
||||
// If .zip archive, document.docx -> document.docx.pdf.
|
||||
for i, inputPath := range inputPaths {
|
||||
outputPath := fmt.Sprintf("%s.pdf", inputPath)
|
||||
originalName := ctx.OriginalFilename(inputPath)
|
||||
outputPath := ctx.GeneratePathFromFilename(originalName + ".pdf")
|
||||
|
||||
err = ctx.Rename(outputPaths[i], outputPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user