So I am using ASP.NET 2.0 and trying to use a simple Form to upload a file to a web service.
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.
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.
<form id="fileUpload" action="http://localhost/AcmeABC/services/FileUploadService.asmx/ImportRates" method="post" enctype="multipart/form-data">
<input type="text" id="fileName" name="fileName" />
<asp:FileUpload runat="server" id="fileArray"/>
<input type="submit" value="Submit" />
[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);
}
}
How can I see what is going on since I don't see any call be made.
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.
Thanks,