can't open api imported attachment?
I am importing from a csv file automatically with a Python script.
All is working perfectly how I want it with the person import and company assignment.
Now I'm trying to attach the original .csv file that i used to import that person onto the "files" section. I've gotten it to actually succeed the attachment, but it errors when trying to download or open that attachment.
Here's the error:
{"statusCode":400,"message":"Folder is not allowed","error":"Bad Request"}
Later on I want to attach a picture alongside this as well, but for now, just the csv is fine
Side question:
I got the required AuthorID from attaching a file myself and then using the findmultipleattachment function to get my own authorID.
What is the proper way of getting this?
8 Replies
Anyone got any idea on this? Havent gotten any further yet
@Dream let me check
Okay, so as it turns out, it's the same problem I've reported earlier https://github.com/twentyhq/twenty/issues/7325
GitHub
After initial upload of file and checking the content, app throws a...
Scenario: Log in Go to People > record details > (doesn't matter which object as long as it has field with File type) Upload a file if there are no files Click on filename Actual: After i...
You can use workaround of renaming any file, after that you should be able to download files
This is an issue in the optimistic rendering logic. I think if you refresh you'll be able to get your file. @bob issue is relevant, we will include a patch in 0.32 🙂
Hey guys. Sorry for the Necro.
I'm still stuggling with this.
I've noticed that the file path when opening the "attached" file is as follows: "/files//twentyscripts/temp_attachments/testcsv.csv?token=" (Note that twentyscripts/temp_attachments/Samuel_Cust_dio.txt is the path that the file is being uploaded from through the python script)
If i attach a file the normal way, the URL for accessing the file is "/files/attachment/fcbb98b1-031e-4b51-bcb0-f596299de025.csv?token="
This might be a me problem but I have no clue how to fix it. Maybe I'm importing it wrong?
Clearly there's some additional changes being made to the file through Twenty, as the name of the file in the URL also changed to an UUID I'd assume?
P.S. Some additional info, the script is basically watches a directory on the twenty instance. Once a csv file is added, that csv is used to create the person or update said person in the twenty database.
But I'd like to attach the original CSV file as an attachment for easy access
@Dream do you still need help here?
I'm Necroing this once more actually. I never saw your response asking if I still need help.
I'm reattempting this now and still running into the same wall.
I can't seem to get a file attached to a person from outside Twenty.
If i attach manually. everything works. If i use my script to attach a csv with the API, it results in the file name being logged but undownloadable and unviewable.
I've figured out that it is caused by how it's being attached by the api through my script, but I don't see any way to do this differently.
Mind explaining if this is even possible?
The end goal is the same as last time. I have a python script monitoring a directory. Any csv files added to this directory is imported to Twenty. I would love if the original CSV could be attached after the record is created automatically.