November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
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?
Solved!
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));
blob.Write(file.InputStream);
file1.BinaryData = blob;
item.FileRef = contentRepository.Save(file1, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
Hi
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
\blobs\19130d49edd84c2483d6c44169fc1e5e\c58b93637cd84d7690e604a2aec03912.jpg
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....
/Fredrik