5

Is it possible to upload a file when using application/x-www-form-urlencoded? i am following html code but it is only uploading/sending the formfields rather real uploading of the file.

<form name="form1" method="post" action="api/upload">
    <div>
        <label for="caption">Image Caption</label>
        <input name="caption" type="text" />
    </div>
    <div>
        <label for="image1">Image File</label>
        <input name="image1" type="file" />
    </div>
    <div>
        <input type="submit" value="Submit" />
    </div>
</form>
1
  • you are posting the data to that URL api/upload directly or using JSON to post the form. In what language you are programming beside html?
    – Avijit
    Jul 16, 2019 at 10:26

1 Answer 1

1

According to W3, you should use multipart/form-data when including a file in your submission.

1
  • 2
    Hi Mason, you are a right but i am trying to troubleshoot an issue here. The Website (not in my environment) is using application/x-www-form-urlencoded for files upload and i was wondering if i can get simple html code to test. Feb 18, 2015 at 3:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.