nizam0786's avatar

How to rename original file name without extension after file upload?

Hi guys,

I am trying to create a rename function which will allow the user to rename the original file name of the uploaded file.

I can rename the whole name however, I don't want the user to be able to edit the extension rather just the name on its own.

e.g. if an uploaded file is named 'testDocument.pdf' I just want the user to see and be able to rename 'testDocument'

thanks in advance.

0 likes
3 replies
tykus's avatar

At what point do you offer this functionality to the user? The server will know nothing of the uploaded file until a request is sent - then a further request is required to rename the file??

nizam0786's avatar

Thanks for you reply @tykus It is offered after the file is uploaded.

There is a documents section which lists all uploaded files and there is an option where the user can rename the file.

nizam0786's avatar

I am just trying to figure out how to just change the text on its own without editing the extension. I don't want users to remove the extension when renaming.

hope that makes sense.

Please or to participate in this conversation.