Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add renameUpload ajax-functionality #23

Closed
wants to merge 1 commit into from

Conversation

codeflorist
Copy link
Contributor

Hi!

First of all thanks for making this! :)

You've recently added the functionality to rename a file, but the server only got that information, if the upload had not taken place yet (e.g. when using auto-upload).

With this pull request, i've changed that functionality to behave like file-deletion. A PUT request is fired now, when the name is changed and auto-upload is used.

Feel free to merge if you deem it useful!

Best wishes
Gerald

@safrazik
Copy link
Owner

Hi,

Thank you for the pull request. Had an overall look at it. It's great that you added a rename event for VueFilePreview component because that component can already be used standalone from last version (not documented yet). Everything makes sense. But I'm too curious about using PUT request. Is there any specific reason for that? Is it just to align with REST protocol methods?

I will do some testing on my side and merge the code.

Thanks again.

@codeflorist
Copy link
Contributor Author

Yes, i thought it would make sense to utilize RESTful HTTP-requests. I'm mainly using Laravel (a PHP framework) and it bases its routing-logic on RESTful requests. I guess a lot of server-side frameworks or APIs do. PATCH would also be an option. This way the server can route a POST request to store a new file and a PUT request to update an existing one to separate controllers using the same endpoint (uploadUrl).

Btw, i was also thinking about adding props for deleteUrl and renameUrl to VueFileAgent, in case the URI's differ. If not set, they could still fallback to uploadUrl to keep the current behaviour. Let me know, and i'll add a commit!

@safrazik
Copy link
Owner

Thank you @codeflorist for your contribution. Your pull request helped big time in the update/rename functionality available from v1.35. I'm sorry I couldn't merge the pull request for certain concerns, but copied certain code from your pull request. You may see the code for the changes. Thanks.

@safrazik safrazik closed this Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants