1

I am working with file posting in c#. I have posted a file from client side using ajax, with the following code

<script type="text/javascript">
  function send() {
    var fd = new FormData();
    fd.append("fileToUpload", document.getElementById('filecontrol').files[0]);
    var xhr = new XMLHttpRequest();
    xhr.open("POST", "getFile.aspx");
    xhr.send(fd);
      }
</script>
<input type="file" id="filecontrol" />
<input type="button" onclick="getFile()" value="Upload File" />

and in the server side, i retrieved that file using the code,

 HttpPostedFile hpf = Request.Files[0];

I need to send this file to another domain using http post. Is it possible to send that hpf using http post?.

1 Answer 1

1

I think you should be able to do that. There are many ways to do that. here is a link Upload files with HTTPWebrequest (multipart/form-data)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.