MCImage Manager handling 2 websites with common folder - tinymce

My Requirements
Implement MCImageManager so that users can upload images to a
"centralized" folder
Allow users to select an imagae on the centralized "ImageLibrary" and place it on a web page or blog post
IMPORTANT:
There's one challange that I need to find a solution for. Typically images are placed in a folder that exists in the website e.g. ~/Images or ~/Content/Images
The challange we have is that I will be having, however web pages will be displayed through separate websites. More specifically, in a typical scenario, a user would upload an image through MCIMageManager that places the file in a folder in the web application. So the image may be uploaded to a folder like D:\xyz\ImageLibrary.
However, the root folder may be F:\ on an entirely different server.
Therefore we need to come up with a way to share image folders between two websites so that regardless of where the image folder may be, the image will display correctly both on xyz web site management module AND the actual website.
Regards
Abhishek

For this use case you should mount the upload directory of server A to the upload directory of server B.

Related

Is there any way to have a text file on the server be readable only by the browser?

I have a few pages on my web server that extract data from text files that each contain a JSON string. The pages use $.get
Is there any way to allow only the server/webpages access the files? I would prefer to not have people going to the file path and saving the JSON data to their computer.
If I set permissions to deny access to the default IUSR, then people visiting the site won't be able to load them.
Any tricks around this?
I put such files in a directory tree out of the one the web server can see. e.g., html pages accessible by the browser go into /var/www/public_html/filename.php, but files that should not be seen go into /var/privateFiles/anotherfile.txt. The web server root is /var/www - so the web server cannot see anotherfile.txt, but filename.php can include it using full path name.

Zend display image

Hi i'm using zend framework and what i want is to show an image.
My image is in a folder /uploads/photo/default.jpg.
If i move the folder to /public/... everithing works fine but I would prefere to leave there if i can because all images are profile's image so i don't want to leave them in public...
My code to show the image is
<img id="image" src=<?php echo $this->baseUrl().'/uploads/foto/default.jpg'; ?> >
And I know that it don't work but there are a way to leave my folder there changing my code?
The images need to be publicly accessible so a browser can view them. If you don't want to physically store them in the public folder you either need to make them accessible from there (by creating a symlink from public/uploads to your uploads folder), or serve them via. a PHP script, which would be able to read the data from wherever the file is located.
Serving binary data via. PHP has its own issues, as it will be slower and you'll need to ensure you send the appropriate headers. But this would allow you to restrict access, e.g. only allowing users to view their friends' profile images, if this is your goal.

Image bank folder with Plone on multilingual site, browseable from TinyMCE 1.3

I'd like to create an image bank folder in Plone
All photos are uploaded here by default (even from TinyMCE)
All photos are language neutral by default: can be set per type with LinguaPlone somehow? To be shared across languages.
Album view (easy)
The folder is in site root below /en, /de etc. language folders and browseable from TinyMCE (the latest beta)
What suggestion and experience you have from the set-up described above? The goal is to have fool-proof setup that
The site users always upload photos to the same folder
The site users always start browser "Add image" from the the same folder
To not fight against the framework I would try a synchronization between photos repositories of each languages.
/en/photos
/fr/photos
/xx/photos
If photos are uploaded under one of them, copy it to others as the translation of the created one.
It will be easier than playing outside of navigationroot, tinymce, ...
Just to do the follow up.
This problem has been now solved:
http://opensourcehacker.com/2012/08/03/adding-custom-shortcut-links-to-tinymce-dialogs-in-plone/

tinymce file browsers multiple file source

I am doing some updates to a site I have developed over the last few years. It has grown rather erratically (I tried to plan ahead, but with this site it has taken some odd turns).
Anyway, the site has a community blog ( blog.domain.com - used to be domainblog.com) ) and users with personal areas ( user1.domain.com, user2.domain.com, etc ).
The personal areas have standard page content that the user can use, or add snippets of text to partially customize. Now the owner wants the users to be able to create their own content.
Everything is done up to using a file browser.
I need a browser that will allow me to do the following:
the browser needs to be able to browse the common files at blog.domain.com/files and the user files at user_x.domain.com/files
the browser will also need to be able to differentiate between the two and generate the appropriate image url.
of course, the browser access to the user files will need to be dynamic and only show those files particular to the user (along with the common files)
I also need to be able to set a file size for images
the admin area is in a different directory than either the blog or the user subdomains.
general directory structure
--webdir--
|--client --
|--clientsite--
|--blog (blog.domain.com)
|--sites--
|--main site (domain.com)
|--admin (admin.domain.com)
|--users--
|--user1 (user1.domain.com)
|--user2 (user2.domain.com)
...etc.
I have tried several different browsers and using symlinks but the browsers don't seem to be able to follow them. I am also having trouble even setting them to use a directory that isn't the default.
what browser would you recommend? what would I need to customize to make it work.
TIA
ok, since I have not had any responses to this question, I guess I will have to do a work around and then see about writing a custom file browser down the road.

Non class files with Java Web Start

How do you distribute other files needed by your application that aren't in a jar file? For example, the application at http://www.javabeginner.com/java-swing/java-swing-shuffle-game . The download contains Shuffle.jar, Shuffle.bat, Score.dat, and an images folder with 3 images in it. I can see possibly putting the images directly in Shuffle.jar, but you wouldn't want to put Score.dat in the jar file because it changes. Is there somewhere you could identify this type of file in the jnlp?
The non-java files should be stored as resources. For files that change, you store the original or template file also as a resource in your jar. When the program starts, you have it check the local system to see if that file exists. If not, it creates the local file by copying the template file from the JAR resource. If the file already exists, then it is used as is.
To save files to the local system, even when running in the sandbox (unsigned), you can use the PersistenceService (javadoc / example). If your java application is signed, then you can use the regular File apis to write the file to the local machine, such as in a ".yourgame" subfolder under the user's home folder.
You can put all those files (except the scores file) in your jar file and load the contents using resource loading.
I've just deleted and restarted my reply twice now, changing my answer each time; this is confusing and needs a bit more clarification.
Are you SURE that application is supposed to be a Web Start app? On the site you linked to, it doesn't appear to be. Are you trying to take an application that was not designed as a Web Start application and change it into one that can be Web Start?
If it's not a Web Start app as your tag implies, then this question is open ended. You can distribute it 100 different ways.
If you are indeed trying to convert it into a Web Start app, you can start by packaging the images into the jar and that will alleviate your first headache if you just read them from there instead of from a File(). If it's going to be Web Start, then you need to decide how you want to keep scores. You have to decide what the scoring system is like before you can decide on how to go about it; will all the scores be kept on the web site hosting the Web Start app? Will that part still be local? If you want to get access to the local file system, you need to sign the jar, then you can extract the score.dat to the file system and do whatever you want with it if the end user accepts.
You need to figure out what you want to do before you can do it, or at least clear it up for us if you already know more than we know you know.