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

There is no name attribute to get the image on backed #62

Closed
MdFarzan opened this issue Oct 5, 2022 · 4 comments
Closed

There is no name attribute to get the image on backed #62

MdFarzan opened this issue Oct 5, 2022 · 4 comments

Comments

@MdFarzan
Copy link

MdFarzan commented Oct 5, 2022

Hi, I was using this utility to upload a profile image but there is no name attribute to get the image on backend (I am using codeigniter on backend). and when I did set it (name attribute) I was getting en empty array with no attributes (like size, name etc).

@johndatserakis
Copy link
Owner

Hmm, really the main thing this library does is hold the File that was uploaded, and put it in an array. As can be seen in this screen shot from the demo, after I upload an image, I can see it there in the console.

If there's an issue receiving the file on your backend, you may need to look at the method with which you make your API call. You're most likely not packaging it as a proper File type, so by the time it gets to the backend it's not readable.

I've answered a few questions like this before - maybe those can help:

You'll probably want to research how to use FormData with Codeigniter - sorry, I don't have any Codeigniter experience.

@MdFarzan
Copy link
Author

MdFarzan commented Oct 6, 2022

Oh, Now I understood. This utility can only upload a file using ajax as it's not holding any file. Correct me if I am wrong?

@johndatserakis
Copy link
Owner

Well really that's how all front end file uploading is going to be - sending it to the backend is going to be through some form of API call.

How you handle that incoming depends on your backend. For example, with PHP, FormData works just fine. For Codeigniter, I'm just not sure of the process needed there. Sorry I can't be of more help.

@MdFarzan
Copy link
Author

MdFarzan commented Oct 7, 2022

Ok, Thanks for your reply.

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

No branches or pull requests

2 participants