I am using POST as discussed here to upload an image and some parameters to a server. On the server side i am using a stream to accept the image data but as its my first time I seem to be doing something wrong. Can someone point me to the right direction.
EDIT: Using the same code on client side(iPhone) as described in the link above. and my server code is something like this. Using a stored procedure to insert into the DB but i am not sure if the POST even reaches the method.
public void PublishIncident(string latd,string longt,string description, string picdatetime, Stream data)
{
latd = latd.Replace("-", ".");
longt = longt.Replace("-", ".");
string sImageName = string.Empty;
DatabaseHelper dalInstance = new DatabaseHelper(sConnStr);
try
{
dalInstance.AddParameter("pDescription", description);
dalInstance.AddParameter("oImageName", "", ParameterDirection.Output);
dalInstance.ExecuteNonQuery("rt_InsertIncident", CommandType.StoredProcedure);
sImageName = Convert.ToString(dalInstance.Command.Parameters[4].Value);
_streamToFile(sImageName, longt, description, picdatetime, data);
}
catch (Exception excp)
{
dalInstance.Dispose();
throw excp;
}
finally
{
dalInstance.Dispose();
}
}
When i run it from the iphone i get a page not found response.