Hi,
I have a question.
Is it possible to rename a file after its upload fails?
as of now i'm getting an error EPERM: operation not permitted, rename... when i try to rename the file.
May i know why its not permitted to rename the file even if the upload is already aborted?
Are there any work arounds so i can rename the file if it is possible? I really need to do it.
Is this related why i cant rename a file?
i also tried closing the browser and a pop up says that
This means 'there is a possibility that the changes you have made will not be saved'.
Is it possible to rename a file after its upload fails?
If upload fails, file will be removed. So, no you can not rename file which is removed.
Or I've got your question wrong..
May i know why its not permitted to rename the file even if the upload is already aborted?
As I've said you probably trying to rename file which is in the process of removing, or at least it has open descriptor and it;s locked on FS level
i also tried closing the browser and a pop up says that
I assume what upload is not finished.
Anyways could you describe more, like why upload is aborted? Why upload fails?
If upload fails, file will be removed. So, no you can not rename file which is removed.
Mine does not get removed. lol
i tried to delete the file while uploading is ongoing. here are the screenshot of logs of what happened.


and the file is still exists in my storage path.
I assume what upload is not finished.
I'll try to test this more. I'm thinking that i can make a work around for my situation.
Where and how do you actually remove the file?
Mine does not get removed. lol
It may be removed by continueUploadTTL. Otherwise _MF_ will keep open descriptor, which should lead to file locking
i did not do anything in the codes. you said that it will be removed automatically so i simply tried to do an upload and make it fail (by deleting the file thats being uploaded). and then i check my file system and its still there. i set continueUploadTTL: 5 so i can see the changes immediately. but the files are not disappearing in the folder
I meant what exactly do you do (_what command you're execute_) to remove the file?
shift + delete
permanent delete :D
Okay, if you changing continueUploadTTL without resetting MongoDB collection indexes it wouldn't apply, see code here (_as it based on top of Mongo's TTL_).
you need to remove __pre_* collection or reset indexes on it
Thanks. I'll try this and report immediately.
ahm... how do i drop it in the shell? my collection name is Files
I'm typing db.__pre_Files.drop() and its an error.
I've protected special collection from prying hands.
Use:
db.getCollection('__pre_Files').drop()
thank you for the help. this is what i've been looking for. i thought the continueUploadTTL does not work for me. it worked.
Hooray! Glad it helped you.
@ck23onGithub I saw some messages posted by you. But can't find them here. I guess it is solved, right?
i deleted it because i was confirming it. its about the file that is being deleted if the upload fails.
the problem i saw is that sometimes, the file descriptor does not close immediately after the upload fails. is there any work around for this?
and if the upload fail, if i retry to upload it, will it append? given that my continueuploadTTL is 5.
the problem i saw is that sometimes, the file descriptor does not close immediately after the upload fails. is there any work around for this?
if there is none, what is the reason why this happens? maybe if its really impossible to make sure that this issue does not happen, a good explanation will be good to make it acceptable. :smile:
and if the upload fail, if i retry to upload it, will it append?
Not it's possible only for paused uploads. Like you can start big file upload, close you laptop, go to other location open laptop, and click "continue" button.
Can not answer other question, as I can not see the issue there. Lib is good at descriptors and files management.
hmm. its causing a big issue when the file desciptor is not closed. the next upload always fails.
though there are times that when i delete the file i am uploading, the file is immediately removed in the sources of the debug tool of the browser
I see no connection between fd (_which is server only_) and "sources" in browser
regarding continueuploadTTL, this starts when the upload starts, right? if my continueuploadTTL is set to 5sec, and my upload does not finish within 5sec, will it trigger an error?
regarding continueuploadTTL, this starts when the upload starts, right? if my continueuploadTTL is set to 5sec, and my upload does not finish within 5sec, will it trigger an error?
Right.
OMG. . . i thought that if it is in progress, the timer will reset. . . so this is my issue. i thought something weird was going on with my app. oh no. . . :laughing:
after the set time in continueuploadTTL, the file descriptor will be closed, am i right?
after the set time in continueuploadTTL, the file descriptor will be closed, am i right?
Right, or right after file is uploaded