Umbraco media sharing - Development - umbraco7

been struggling with setting up Umbraco on a development machine and test server...
Both environments connect to the same database and I use uSync to keep all my changes in git, however mediafiles are a real p.i.t.a.
I started off by adding media on my dev machine and copying over the media folder when publishing to test. Not very elegant so I tried using the rootPath and rootUrl in the filesystemproviders config. Path points to a network file share and URL to a dedicated virtual directory hosted on a media.test.mysite.com subdomain.
Surprise ... when opening the site the old media is vanished because umbraco saves the absolute path in the cmsProperty tables {'src': 'http://media.mysite.com/1041/...' }, previously the relative path when configuring the virtualRoot.
I'd like to alter the composition of the media url's in both front-and backend. Define a media_root appsetting holding the hostname, protocol and port (http://media.test.mysite.com) and prepending this to the src stuff that comes from the DB...
Any suggestions?
I already tried a custom URLProvider but this only works for non-media content ... it seems :-|
Thanks!
Y.

I'd recommend using the Umbraco File System Provider for Azure which will upload your media to Azure Blob Storage. You can then use the disk cache that comes with ImageProcessor.Web (included in Umbraco Core) to cache the files locally. We run our dev environments pointing to the same blob storage as other environments - so no need to copy the files. And the references are relative (/media/1001/file.jpg) when using Disk Cache thanks to the HTTP module in ImageProcessor.Web which caches them to disk. (You could alternatively use the ImageProcessor Azure blob cache plugin and have the images load from Azure. You might want to check out this documentation at Our.Umbraco.org (even if you aren't using Umbraco Cloud).

Related

How do you change the default cache directory when publishing a service in arcmap?

I am trying to publish a service using arcmap and I need to cache the layers on this service when I publish it.
The default cache directory is in a drop down list for which there are no other available options, and this directory is located on the C drive.
However I need to change this so that the caching takes place on the Z drive instead as I have no available space on the C drive.
Can this be done and if so how can this be done? Changing the display cache directory from the arcmap options did not change the location of the cache when publishing a service.
This needs to be set in ArcGIS Server Manager, before publishing in ArcMap.
Instructions are found on ArcGIS Server help page:
By default, the server directories [including cache directories] are installed at <ArcGIS Server
installation directory>/arcgis/server/usr/directories. You can manage
your server directories in Manager by navigating to Site > GIS Server > Directories
So you'd want to add something like:

Temporary storage for Azure WebSites

I want to cache some cropped images and serve them without calculating them again in a Azure WebSite. When I used the Azure VM I was just storing them at the D drive (temporary drive) but I don't know where to store them now.
I could use the Path.GetTempPath but I am not sure if this is the best approach.
Can you suggest me where should I store my Temporary files when I am serving from a Azure WebSite?
Azure Websites also comes with a Temp folder. The path is defined in the environment variable %TEMP%
You can store your images in App_Data folder in the root of your application or you can use Azure CDN for caching.
You could store the processed content on Azure Blob Storage and serve the content from there.
If what you really want is a cache you can also look into using the Azure Redis Cache.
you can use Path.GetTempPath() and Path.GetTempFileName() functions for the temp file name, but you are limited though in terms of space, so if you're doing a 10K save for every request and expect 100,000 requests at a time per server, maybe blob storage is better.
Following sample demonstrate how to save temp file in azure, both Path and Bolb.
Doc is here:https://code.msdn.microsoft.com/How-to-store-temp-files-in-d33bbb10
Code click here:https://github.com/Azure-Samples/storage-blob-dotnet-store-temp-files/archive/master.zip

media folder on another server using symlink? (Magento)

is it possible to have my magento store on one server and have the store media folder on another server using a symlink?
Would I run into any problems if I was to do this?
I don't have any experience with symlinks and not exactly sure how they work.
You have to mount second server directory on your first server and than you can created symlink for this mounted point. ssfs is the tool I use for mounting.
But I will not recommend doing this because performance wise it will be slower, but in other hand if you can setup any domain/subdomain on that second server then you can provide your remote media url in Magento's system configuration, just like cdn server configuration. And it will enhance performance.

Access to filesystem on AppHarbor

I want to try AppHarbor, but I have an application which stores uploaded files in certain place on a filesystem. Is it compatible with AppHarbor? Can I store files in the file system and access them later?
(what kind of path can I expect, like c:\blabla something or what?)
Thank you.
You can store files on the local filesystem, but the application directory is wiped on each new deployment so it's not recommended to rely on for file storage.
Instead we recommend that you use a cloud storage service such as Amazon S3, Google Cloud Storage or similar. There are .NET libraries for both services.
We recently wrote a blog post about uploading files directly to S3 and GCS from the browser that you might want to read.
If you are using a background worker, you need to 'Enable File System Write Access' in the settings of you application.
Then, you are permitted access to write to: Path.GetTempPath()
Sourced from this support question: http://support.appharbor.com/discussions/problems/5868-create-directory-in-background-worker

Storing web server images in windows C drive

I am running tomcat and I have some custom images which when I store on my C drive do not show up.If I move them to webapp root foder, they r fine but I do not want these images to end up in the war file.As I am using Windows symbolic link is not an option. Any idea as to how I can make the images show up without storing in the webapp root?
The web server will need the images to be stored in a web folder (root or virtual directory) to interperet the URL to a local file location.
If on the other hand you are referencing your images using file:// then the web server is not serving the files, the OS is, and will only work for local users that have access to the files.
Well, you can also manage them by your app - that is when you get the request for the image, your application reads it from the disk, sets proper Content-type and outputs the image.
That is not recommended tho. Better leave this job to the web server.

Resources