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

Feature: support handle image uploading manually #205

Closed
zhaoyao91 opened this issue Feb 9, 2020 · 8 comments
Closed

Feature: support handle image uploading manually #205

zhaoyao91 opened this issue Feb 9, 2020 · 8 comments
Labels
Milestone

Comments

@zhaoyao91
Copy link
Contributor

Currently we can only specify an uploading url, but in many situations the uploading processes are quite different from there to there.
It would be great if we can specify an custom function to fully handle the image uploading.

@JiHong88
Copy link
Owner

JiHong88 commented Feb 9, 2020

Hi @zhaoyao91
Can you give me an example of how it should be?
I don't know much about it :(

@zhaoyao91
Copy link
Contributor Author

for example, there may be another image option imageUploadHandler, which is an async function like async (imageFile) => imageUrl

@MRB60
Copy link

MRB60 commented Feb 9, 2020

I agree that a function call wound be nice. I use FetchAPI style myself.
I also miss that I cannot add additional info (like user reference) prior to upload and in the reply callback. At the moment I misuse filename for that.
However, FetchAPI might render incompatibility and it is very good that Suneditor has no dependencies.

@JiHong88
Copy link
Owner

JiHong88 commented Feb 9, 2020

Um.. Do you need a function that will be called just before an image create to modify the information in the image?

@MRB60
Copy link

MRB60 commented Feb 9, 2020

I need the be able to add custom parameters to the POST request - and receive custom parameters in reply. @zhaoyao91 might need to do more of course.
As an example, in another part of my code (not used with Suneditor), I allow image rotation and upload of thumbimage (generated, scaled down done in js) togther with original image.

@JiHong88
Copy link
Owner

JiHong88 commented Feb 9, 2020

Okay.
First, I'll add a custom parameter.

@zhaoyao91
Copy link
Contributor Author

zhaoyao91 commented Feb 9, 2020

The current uploadUrl way may be convenient for some cases, but it is not flexible and extensible.

By supporting the uploadFunc, which is lower level in abstraction, you can span more situations without any effort.

The two ways are not conflicting. But I think capability is prior to the ease-of-use.

JiHong88 added a commit that referenced this issue Feb 20, 2020
@JiHong88 JiHong88 added this to the 2.26.0 milestone Mar 4, 2020
@JiHong88 JiHong88 closed this as completed Mar 4, 2020
@JiHong88
Copy link
Owner

The 2.26.0 version has been updated.
If there is an issue, please register as a new issue.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants