CakePHP Get absolute links of images from uploads folder - php

Hi guys I could use some help on getting absolute URL links to show images with cakePHP without HTML helper.
So I wrote a webservice(webservice communicates in json) for an application that is being ran on iOS. Now the problem is people can upload images from the application to my webservice, they get stored in webroot/uploads folder.
Now I want to show the images on my application in real size if they click on them(using thumbnails for the smaller ones, using a controller which creates thumbnails) the problem is when I point out to webservice.com/uploads/imagename, it says controller uploads can not be found(pretty obivous but hey). So my question is how can I get the absolute links to the images without needing a controller, so when I go to the URL of the image it just shows the image in my browser and on my application, and I can't use views for this cause it needs to show on the iOS application.
Any help would be greatly appreciated.
Thanks in advance,
Sokoo

Related

generating a link while retrieve list of files and folders in dropbox using dcblog laravel dropbox

I am using an package called laravel-dropbox. I am using it and find very helpful too. But now I am in a little bit trouble while I need to generate the link of files so that I can show the images which I have been uploaded so it will be better I will get the all files and folder with their links then it will me a lot. Currently I am getting all the files and folders and its working fine from below method
return \Dcblogdev\Dropbox\Facades\Dropbox::files()->listContents($query);
like after using this method I am getting the following output
but here I dont get the links so that I can't show the uploaded images to my website. So, please help me so that I can show user the uploaded images of dropbox into my website like below response
Please Help me to get the desired result

Get small thumbnails from bigger photos

I have a galery of users that show all of user photos. I want to have small thumbnails for each photos.
How to make it?
Also I notice some website even create thumbnail that focus on the face part of the original photos.
I don't have any code just looking for suggestions.
Im using PHP, Codeigniter, Angularjs, Jquery.
Thank you!
In your controller when receiving the file, before uploading it, you need to do some processing to it. each image you will save it in 4 or 3 sizes, it will be like this for image called imageHello.jpg:`
site.com/images/large/imageHello.jpg
site.com/images/small/imageHello.jpg
site.com/images/thump/imageHello.jpg
So basically it will be site.com/images/[size]/imageHello.jpg, in the front end side you will file the size with what you want based on the page.
for zooming you can use this library, look at this example

How to show images in a webpage from root directory in PHP Codeigniter?

I have made a site with Codeigniter and users have options to upload their photos there. As the photos are personal, I think keeping them on web directory is not safe. As a result, I kept them on a root directory like /var/www/images directory. Now, how I can get the images in a webpage?
Wrong Choice dear learner. you images folder needs to be accessible by your code and to the browser to render that image by the image path. For example
This is the image directory of my project. I am using all these images in different pages of my website. Some are selected dynamically by my code.
Now in your case by putting images in www folder, you are making a path of http://images/ which is not recommended by any PHP guidelines. Your images folder should be in your project root not outside.
If you want to disable folders to be viewed, just add empty index.html file, but if you try to protect images from being viewed then your website wont be able to find them too image protection in codeigniter
The code will be as safe as you make it. Well what you are doing is fine, the web server will still have to access the images.
While ignoring the rest of your code or what yo are trying to achieve, you could try referencing the images fro your webroot or probably create a symlink.
Also, I would try to put the images in another place like AWS.
If security is a concern for you, you can try building a ImagesController that checks if image exists, if user has permissions to see it and after that render it.
Uploaded images should also have some reference row inside a table in your database that can have a column which specifies if it should be public (also try to sort them to folders depending on what it represents - user profile pics, product images, etc).
I know it's a little bit of work but this would be the way I would do it.
You can check online for examples of controllers that return an image.
Good luck on your project.

using angularjs how can i get thumbnails of pdf and video?

I want to make thumbnails of pdf,images and video file using angularjs
I found one git example for that
https://github.com/aztech-digital/angular-thumbnails
Please go through the link i have tried this but i am new in angularjs and I dont know how to call a directive.
Please help me to implement this i am using php codeigniter with angularjs
what I want is I have an option to upload multiple files which will contain pdf,doc,docx,xls,mpg,jpg etc.I want to create a thumbnail of all these type of files. for eg: if a case I am uploading pdf the first page of pdf should be the thumbnail of that file.
how i can implement this example
here i saw one example which will create only for images
Thank you

Dynamic Image Gallery that looks in multiple album folders

Can anyone advise on a great image gallery that's dynamic, client side.
Basically what I want is on my website a gallery with multiple albums and images in the albums. To be able to add images dynamically to the folder or remote site (such as Photobucket or Picasa) and the webapage to be able to display them dynamically without any further coding, avoiding the hassle of having to add a lines of code ever time a new image is added.
Anybody using something like this or can point me in the right direction?
Much appreciated.
I found what I was looking for in Picasa Webalbum Integrator javascript library.
http://code.google.com/p/pwi/

Categories