Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty file after API upload #753

Open
Nasty opened this issue Feb 27, 2024 · 1 comment
Open

Empty file after API upload #753

Nasty opened this issue Feb 27, 2024 · 1 comment
Labels

Comments

@Nasty
Copy link

Nasty commented Feb 27, 2024

Hi,

I created my own file upload script for the API (Teedy Docker v1.11 & v1.12)
After uploading, this file was not found...
image

This is the log from the docker.

27 Feb 2024 22:36:17,284 INFO com.sismics.docs.core.util.FileUtil.startProcessingFile(FileUtil.java:221) Processing started for file: 563d23bd-eed4-4301-9dc1-63b80f6b1087
27 Feb 2024 22:36:17,352 INFO com.sismics.docs.core.listener.async.FileProcessingAsyncListener.on(FileProcessingAsyncListener.java:53) File created event: FileCreatedAsyncEvent{fileId=563d23bd-eed4-4301-9dc1-63b80f6b1087, language=null}
27 Feb 2024 22:36:17,751 INFO com.sismics.docs.core.listener.async.FileProcessingAsyncListener.extractContent(FileProcessingAsyncListener.java:176) Start extracting content from: File{id=563d23bd-eed4-4301-9dc1-63b80f6b1087, name=Protokoll Sitzung 12.01.2024.pdf}
27 Feb 2024 22:36:17,775 INFO com.sismics.docs.core.listener.async.FileProcessingAsyncListener.extractContent(FileProcessingAsyncListener.java:182) File content extracted in 23ms: 563d23bd-eed4-4301-9dc1-63b80f6b1087
27 Feb 2024 22:36:17,814 INFO com.sismics.docs.core.util.FileUtil.endProcessingFile(FileUtil.java:231) Processing ended for file: 563d23bd-eed4-4301-9dc1-63b80f6b1087

How I did it:

const response = await request.put({
  url: teedyUploadUrl,
  formData: {
    file: fs.createReadStream(filePath)
  },
  headers: {
    'Cookie': ${authToken},
    'Content-Type': 'multipart/form-data'
  }
}, (err, res, body) => {
  if (err) {
    return console.log(err);
  }
  console.log(`Status: ${res.statusCode}`); //Status: 200
  console.log(body); //{"status":"ok","id":"c6ea3df3-f3d0-4722-9484-f521ef7b76e4","size":70163}
});
@Nasty
Copy link
Author

Nasty commented Mar 1, 2024

The other question is, how can I add "quick uploaded" files to existing documents? If this is not possible, I don't need my upload-bot...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants