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

without ajax post #7

Open
Profile opened this issue Jan 24, 2017 · 7 comments
Open

without ajax post #7

Profile opened this issue Jan 24, 2017 · 7 comments

Comments

@Profile
Copy link

Profile commented Jan 24, 2017

why we cannot get data submit form or how should we do?
I want when form submit this input will upload
Thanks

@ssbeefeater
Copy link
Owner

ss-uploader doesn't support form submit for now. I will consider to add this feature in the next release.

@jaimestuardo
Copy link

jaimestuardo commented May 4, 2019

@ssbeefeater I have downloaded last version and it seems it still does not support it. I need to send the images together with the whole form data.

This is a feature that is basic to have because the more common use case is precisely that. I cannot imagine a real world page that allows to store images in server disk without associating it to anything. Normally that image should be associated to other entity, for example, customer, invoice, process, etc. And to accomplish that, entity should be saved together with the image.

Regards
Jaime

@ssbeefeater
Copy link
Owner

try to use inForm prop also you can use data prop to pass any extra data with the uploaded files check available options here. If these doesnt fit your needs let me know

@jaimestuardo
Copy link

Hello, I think the problem is that I am posting the form using AJAX call. So I was thinking about other alternative.

Posting the form as it is, and returning the ID of the entity the images will be assigned to. However, I need to make your plugin to upload the files upon some method call. However, I did not find any method to upload the files or I did not find in the docs at least.

Have you considered implementing such a method? do you have other suggestion?

Thanks

@jaimestuardo
Copy link

@ssbeefeater Hello... I am trying to make uploadFiles method public so that I can call from the page after the entity is saved, but no success. Can you help me, please?

@jaimestuardo
Copy link

@ssbeefeater I could finally call uploadFiles method after the entity has been saved, however, I encountered another critical problem. "data" property of ssi_uploader cannot be dynamic. I need to pass the current ID returned from database, but the "data" property is fixed having the value when the object was initialized.

I was looking at the beforeUpload method, but the example you wrote only shows how to send a notification. Is there a way to modify "data" property from beforeUpload event?

Thanks
Jaime

@jaimestuardo
Copy link

Finally, I have modified ssi-uploader.js to allow "data" property to be dynamic, this way;

          $.each(thisS.options.data, function (key, value) {
                if (typeof value == 'function')
                    value = value();
                formData.append(key, value);
            });

That way, if "data" parameter is a function, that is called instead of assigning the value.

I think you could consider all these changes to your plugin.

Regards
Jaime

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

No branches or pull requests

3 participants