I m using RackSpace to upload email attachments. This is how I m trying to upload it to RackSpace Cloud:
//Skipped Authentication Setup
string containerName = ConfigurationManager.AppSettings["ContainerName"];
using (var stream = new MemoryStream())
{
StreamWriter memoryWriter = new StreamWriter(stream);
memoryWriter.Write(file);
stream.Position = 0;
stream.Seek(0, 0);
cloudFilesProvider.CreateObject(containerName, stream, fileName);
}
var header = cloudFilesProvider.GetContainerCDNHeader(containerName, "ORD");
string Url = header.CDNSslUri + "/" + fileName;
This code uploads file of size 0 into Cloud and on reaching to header variable, it throws error:
The item was not found or does not exist
Any help would be appreciated.