Uploaded MediaData blob is empty



Locally everything works fine, the blob write is craeteing the complete medidata blob.

But, on the stage server, the file is created, i can see the file in 


But the file's size is 0 KB ...

So create persmissions should be ok, since the file is there, but why no data?

How can it differ from my local machine?

I can't find any good documentation on this....


Dec 06, 2013 11:38

Adding some info to the case...

Locally I had the local IIS (Express/ Cassini or whatever), and that worked fine

Now I switched to my local IIS 7.5, and same problem occur as on the stage server, files are 0 bytes.

Even though I tried with app identity "LocalSystem".

Sounds familiar?

Dec 06, 2013 13:46


It turned out that I was doing something wrong with the blob writing, it never worked ...

When uploading files with http it is enough with:

var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var blobFactory = ServiceLocator.Current.GetInstance<BlobFactory>();

HttpPostedFile file = Request.Files[0];

var file1 = contentRepository.GetDefault<GenericMedia>(publikation.AssetFolder);

string filename = DateTime.Now.ToString("yyyy-MM-dd_HHmm") + Path.GetExtension(file.FileName);

file1.Name = filename;

var blob = blobFactory.CreateBlob(file1.BinaryDataContainer, Path.GetExtension(file.FileName));


file1.BinaryData = blob;
item.FileRef = contentRepository.Save(file1, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);


Dec 06, 2013 15:16
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.