Hi @NinaDuflo ...
I'm not sure if you have tried this yet, but I'll ask anyway... have you tried saving your file to your computer and then attaching it from your computer (rather than selecting from previously uploaded files or files from your Microsoft OneDrive)? I wasn't real clear on your question if you had tried that or not. If you haven't done that, please give that a shot to see if it works.
This is just general guidance since we don't have access to your school's Canvas environment or your course(s) that you are taking. You should also contact your instructor (if you haven't done that yet) to let him/her know you are having difficulties uploading your assignment attachment.
Please keep us posted here in the Community...thanks!