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.
Related
I have a Google Form that uploads some pictures that I want to be visible to anyone with a web browser. Unfortunately they all arrive as private. Is there any way to have them default to public instead of having to go through and mark them individually?
You simply need to share the folder.
Click View Folder on the bottom-right corner of the file upload question
Change the permission of the folder to Anyone with the link *
*The folder in 1. is the subfolder of the question you selected.
In case there are multiple file upload questions and you want to share all of them, change the permission of the parent folder instead.
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.
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.
I'm trying to automate website testing using powershell. I need to compare one of the images in tag with a file on my hard drive.
Is there a way to access the file without downloading the file the second time?
.. if it's not..
Is there a way to force the browser object (ie9) to get the site without images (without changing it in the settings of the browser) and then download the images individually?
Is it possible to intercept image load requests in WebView before they are actually started and modify their URLs?
For example, I have
mWebView.loadUrl(myUrl);
In onLoadResources event I can see URLs, but I can't modify them?
The thing is I am working on application that loads html content from remote location. For some reason author excluded image path and in img src he just have file name. Existing iPhone application is using this html content and I assume the content is build the way that is the best for iPhone. So, I need somehow to figure how to alter these paths. For example, if I choose to download all images first, I would need to alter path and add file:///... in front of image.jpg name.
Thanks.
you can use onLoadResource although are not only images but any resource loaded like javascript and css