Prannay
Prannay
TTCTheo's Typesafe Cult
Created by Prannay on 7/14/2023 in #questions
Uploading Word Documents (.docx/.docx)
I have been trying to upload .docx files using UploadThing. I used the following configuration:
bookUploader: f({
"application/msword": {
maxFileSize: "4MB",
maxFileCount: 1,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
maxFileSize: "4MB",
maxFileCount: 1,
},
})
.middleware(({ req }) => auth(req))
.onUploadComplete(async ({ file }) => console.log("FILE URL: ", file.url)),
bookUploader: f({
"application/msword": {
maxFileSize: "4MB",
maxFileCount: 1,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
maxFileSize: "4MB",
maxFileCount: 1,
},
})
.middleware(({ req }) => auth(req))
.onUploadComplete(async ({ file }) => console.log("FILE URL: ", file.url)),
The drag and drop functionality works perfectly, but showOpenFilePicker has been giving me the following error on Chrome: TypeError: Failed to execute 'showOpenFilePicker' on 'Window': Invalid type: application/msword/* This problem is only happening with the click to upload button in UploadDropzone, the UploadButton is working perfectly for some reason. Any ideas on what can be done to solve this?
6 replies
TTCTheo's Typesafe Cult
Created by Prannay on 7/6/2023 in #questions
UploadThing with Python
I am using UploadThing on my main app where a user uploads a word document. I save it's UT URL in my DB. After it's submitted, I call a python API which runs some analysis on the document uploaded, creates a new document, uploads it and updates the DB. I looked through the documentations of UploadThing and couldn't find it, so I was wondering if there is any way to upload a document to UploadThing from Python?
7 replies