Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

File input upload image


Hello,


https://keenthemes.com/metronic/tailwind/demo6/account/home/settings-sidebar

I want to use the photo upload area in this link, but I cannot post the selected value here. It gives an error that the file could not be selected. However, when I use standard input anywhere outside the library, there is no problem. Anyone have an idea?


Standard File Input:
image2: File {name: 'resim (1).png', lastModified: 1731595692891, lastModifiedDate: Thu Nov 14 2024 17:48:12 GMT+0300 (GMT+03:00), webkitRelativePath: '', size: 1716294, …}

Library
avatar: File {name: '', lastModified: 1731675149226, lastModifiedDate: Fri Nov 15 2024 15:52:29 GMT+0300 (GMT+03:00), webkitRelativePath: '', size: 0, …}


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi Hüsame Özçelik,

In the input form, there's an input field with the attribute name="avatar", for example:

<input type="file" name="avatar" accept=".png, .jpg, .jpeg"/>


On your backend side, can you confirm if you're able to retrieve the file from the form input name="avatar"? It should be accessible as part of the request payload when the form is submitted. If you're not receiving it, double-check:

- The form's enctype should be set to "multipart/form-data".
- The file is correctly appended when using JavaScript to handle the form submission.
- The backend is configured to handle file uploads (e.g., $_FILES in PHP, request.files in Python Flask/Django, etc.).



Anyone have any ideas?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(