I have a code that looks like following
string outputPreamble = "<gml:FeatureCollection xmlns:gml='http://www.opengis.net/gml' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:fme='http://www.safe.com/gml/fme' xsi:schemaLocation='http://www.safe.com/gml/output.xsd>'";
try
{
blobObject.PutBlock(DataConstants.MAP_CONTAINER_BLOB, DataConstants.OUTPUT_BLOB, Guid.NewGuid().ToString(), outputPreamble);
}
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine("Error writing preamble" + e.Message + "-" + e.InnerException);
}
Thsi returns the error:
The request body is too large and exceeds the maximum permissible limit.
System.Net.WebException: The remote server returned an error: (413) The request body is too large and exceeds the maximum permissible limit..at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest
req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
Isn't 4MB the limit for a block? My PutBlock method looks like:
public bool PutBlock(string containerName, string blobName, string blockId, string content)
{
try
{
CloudBlobContainer container = BlobClient.GetContainerReference(containerName);
CloudBlockBlob blob = container.GetBlockBlobReference(blobName);
string blockIdBase64 = System.Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(blockId));
if (content == "") content = " ";
UTF8Encoding utf8Encoding = new UTF8Encoding();
using (MemoryStream memoryStream = new MemoryStream(utf8Encoding.GetBytes(content)))
{
memoryStream.Position = 0;
blob.PutBlock(blockIdBase64, memoryStream, null);
}
return true;
}
catch (StorageClientException ex)
{
if ((int)ex.StatusCode == 404)
{
return false;
}
throw;
}
}
Dinesh Agarwal