Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving problems using Forms input to upload file to web service
    primarykey
    data
    text
    <p>So I am using ASP.NET 2.0 and trying to use a simple Form to upload a file to a web service.</p> <p>I have the action attrib set to the url of my web service. However, in firefox, I can't see that it is making any call to that service at all.<br> NOTE: I can throw int the below "Action" value to a browser minus the name of the web method and get a page showing the available web method so I believe the URL for the "Action" attribute is correct.</p> <pre><code>&lt;form id="fileUpload" action="http://localhost/AcmeABC/services/FileUploadService.asmx/ImportRates" method="post" enctype="multipart/form-data"&gt; &lt;input type="text" id="fileName" name="fileName" /&gt; &lt;asp:FileUpload runat="server" id="fileArray"/&gt; &lt;input type="submit" value="Submit" /&gt; </code></pre> <p></p> <pre><code>[WebService(Namespace = "http://www.abc.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] [ScriptService] public class FileUploadService : System.Web.Services.WebService { [WebMethod] public void ImportRates(string fileName, byte[] fileArray) { try { MemoryStream memoryStream = new MemoryStream(fileArray); } catch (Exception ex) { string error = string.Format("Error thrown for file {0} with {1} error.", fileName, ex); } } </code></pre> <p>How can I see what is going on since I don't see any call be made.</p> <p>I am also of the opinion that this might not be the best approach. I am new to the entire web development space so I am trying to find better ways of handling problems. Please advice any other approach that might be recommended for uploading a file to a web method.</p> <p>Thanks,</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload