Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8580391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:49:11+00:00 2026-06-11T20:49:11+00:00

I actually want to send a picture to my server using jQuery without using

  • 0

I actually want to send a picture to my server using jQuery without using html form. But I would like to retrieve the same data as I received with an html form with the encode type:

multipart/form-data

I used HTML5 FileReader : http://www.html5rocks.com/en/tutorials/file/dndfiles/

but when I use FileReader.readAsText(Blob|File, opt_encoding) function. The data I retrieved are not encoded as the same as it’s encoded with the html form.

What encoding is used for “multipart/form-data” and is it possible to encode data using jquery or javascript before send them to my server?

//edit

from w3schools : http://www.w3schools.com/html5/att_form_enctype.asp

multipart/form-data ==> No characters are encoded. This value is required when you are using forms that have a file upload control

the problem that I have is that when I retrieve the data from FileReader it’s not the same data that from HTML form data.

for the same picture:
with html form :

\xff\xd8\xff\xe1\x00\x18Exif\x00\x00II*\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xec\x00\x11Ducky\x00\x01\x00\x04\x00\x00\x00U\x00\x00\xff\xe1\x03)http://ns.adobe.com/xap/1.0/\x00<?xpacket begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>...

with FileReader.readAsText():

\xc3\xbf\xc3\x98\xc3\xbf\xc3\xa1\\u0000\\u0018Exif\\u0000\\u0000II*\\u0000\\b\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\xc3\xbf\xc3\xac\\u0000\\u0011Ducky\\u0000\\u0001\\u0000\\u0004\\u0000\\u0000\\u0000U\\u0000\\u0000\xc3\xbf\xc3\xa1\\u0003)http://ns.adobe.com/xap/1.0/\\u0000<?xpacket begin=\\"\xc3\xaf\xc2\xbb\xc2\xbf\\" id=\\"W5M0MpCehiHzreSzNTczkc9d\\"?>

How to retrieve the same data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:49:13+00:00Added an answer on June 11, 2026 at 8:49 pm

    Ok I actually found the answer while testing a lot of solutions and the one I found was a bit weird.

    Actually, I sent the data to my server as Base64 format using the function FileReader.readAsDataURL().

    Then, I split(',') the data to only get the Base64 data in my server side I decoded the data using my_base64_data_decoded = base64.b64decode(my_base64_data_encoded)

    At first I sent these data to Amazon using “boto” and serialize the data using: cStringIO.StringIO(my_base64_data_decoded) and It didn’t work.

    I created a dictionary my_dict:

    and I did my_dict['data'] = base64.b64decode(my_base64_data_encoded)

    and then : cStringIO.StringIO(my_dict['data']) and it worked.

    Now my question is What process has been done to the data while inserting in the dictionary?

    But at least, I found the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Rails 3.0.3 with jQuery ujs. I want to send a form
I actually want to generate random password using PHP uniqid() function $randomPassword = uniqid();
Actually I want to populate an array to fill up my table view, but
I am using javascript for the first time.Actually i want to get the latitude
I want to send mail after specific time Actually I want to send mail
I want send some data to a remote webpage from my site. Actually it
I'm using Rails to send emails and I just want to send a plain
Here's a scenario; I want to send email using PHP and Zend Framework. Here's
actually i want to send a comment to the each image and it should
I'm trying to send an email with an HTML attachment, I don't want the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.