This is not possible using the public API, But the following blog post shows how you can get access to the file on disk.
http://www.meridium.se/sv/blogg/2010/05/14/width-and-height-of-an-image/
/Johan
Hi Johan,
Thanks for your reply, we used the FileWrapper instance as shown in the blog post.
This object contains a public File field which is an instance of FileInfo which contains the correct path to the physical file on disk.
We used FileInfo.OpenRead() to get the stream.
Thanks!
Best Regards,
Robert.
Hi Johan,
How would we do this in ImageVault 4.7?
Thanks in advance!
Regards,
Robert.
In ImageVault 4 there is a backend service that is responsible for storage, conversion etc. This service might be located on another machine and the actual storage of files is handled by a plugable storage provider which might not use the filesystem. Hence you can not get access to the actual file from the client.
You will have to rely on getting the media file using the URL provided by the API.
Though if you need access to the actual files you can write your own storage module for this using the IMediaStorage interface.
If you could describe the problem you want to solve we might be able to provide an alternative solution.
/Johan
Hi Johan,
Thanks, that is what I'm experimenting with at the moment, grabbing the file(s) by their URLs.
We're trying to create a zip file from a subset of imagevault files which people can select on the front-end side.
I've seen some methods on service interfaces in the ImageVault API documentation which (according to their name) seem to create zip files, but I'm not really sure on how to use them and if the zip files are stored on the ImageVault backend.
Regards,
Robert.
You should be able to use the function in MediaContentService to create a zip file.
http://imagevault.se/DeveloperDocumentation/Reference/html/M_ImageVault_Common_Services_IMediaContentService_CreateZipArchive.htm
See this example on how to call the services directly.
http://imagevault.se/en/documentation/api-documentation/?page=csharp/services.html
/Johan
If I would like to get/zip the original format for the collection of files, what would I pass as 'mediaFormatId' parameter in the CreateZipArchive method? And how would I use the returned string?
Regards,
Robert.
Try something like this
var mediaContentService = client.CreateChannel<IMediaContentService >();
var key = mediaContentService.CreateZipArchive( new [] {2520,2519,2491} , 1);
var url = new Uri(new Uri(ClientConfigurationSection.Instance.ImageVaultCore.CurrentAddress), "MediaStreamService/Archive/" + key + "/package.zip?download=1");
/Johan
That works like a charm. But it leaves a file on the server though. Is there anyway to configure imagevault so that these are cleaned up in some sort of way. Or should we implement some sort of garbage collection on our own?
Thanks!
Regards,
Robert.
We are currently working on a project which uses ImageVault 3.5 and we need to get a stream or byte array of several files. Does anyone know how to do this? IVFileData.OpenRead() doesn't seem to work. When looking at this class with a decompiler we see the following code.
public Stream OpenRead()
{
throw new ApplicationException("ImageVault does not support read with Unified File System");
}
Thanks in advance!