Storing web server images in windows C drive - image

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.

Related

Heroku PlayFramework - create thumbnail

I already have PlayFramework app runing , but I am in process of migrating it to Heroku. Because on Heroku I can not use local filesystem like I did in my app. I am forced to use Amazon S3 ,but I do not know how to rewrite creating of thumbnails. For that I am using :
https://github.com/coobird/thumbnailator
Thumbnails.of(picture.getFile()).size(300,300).toFile(new File("public/images/data", thumb));
The problem is that I can not do this at heroku,because file wont be saved.
How do I create thumbnails then? If I do not want to use another service which will generate thumbnails for me and save them to s3 somehow...
Honestly if I would know how many different services would I need for simple page with java then I would stay at php forever...
In Heroku (as in many PaaS) there's no persistent filesystem. However, you do have access to temp directory.
So you could save it into a temp file
File temp = File.createTempFile("prefix", "suffix").getAbsolutePath;
Thumbnails.of(picture.getFile()).size(300,300).toFile(temp, thumb));
Then take that file and upload it to S3.
If you strictly insist on not using S3 for storing binary files, then you could base64 the file content and save it into the DB. (see some pros/cons for such approach here)

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:

Umbraco media sharing - Development

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).

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.

Blobstore Images Disappearing on Google App Engine Development Server

I'm using App Engine's high performance image serving on my site, and I'm able to get everything working properly on both my local machine and in production i.e. I can upload an image and successfully display the images using get_serving_url on the blob key. However, these images don't seem to persist on my development server, i.e. after I come back from a computer restart, the images no longer show up. The development server spits out:
images_service_pb.ImagesServiceError.BAD_IMAGE_DATA
which I'm guessing is actually because the underlying blobs are no longer there (although this is just a hunch). The rest of my datastore is still intact though, as I'm using the launch setting "--datastore_path" to ensure my data persists. Is there a separate flag I need to be using to persist the blobs as well? Or is there a separate problem here that I'm missing?
You must use --blobstore_path=DIR:
--blobstore_path=DIR Path to directory to use for storing Blobstore
file stub data.
You can see all options typing dev_appserver.py --help in the command line.

Resources