Save a Favicon in ubuntu for PHP page - php

i want to add a favicon to my PHP page at my Ubuntu server. unfortunately, i don't know how to add an image (favicon.ico) to my server an save it there. I tried to find an answer to that but it seems like i'm eather searching wrong or i just don't understand it properly...
Ubuntu 18.04.5
thanks for any help!

Great question. At the very least you will want a favicon.ico file on every website or web application to identify your company or application's brand.
A "favicon.ico" file is nothing but an image file with your brands icon. But it needs to be in a particular format (ico) for web browsers to read it.
Web browsers use this .ico file whenever you bookmark a webpage to give a visual identification to the resource you are saving.
All that aside, you can convert a graphic to .ico format yourself using image editing software or use many online tools to convert regular images or graphics to this format. If you use an online service (recommended), then you will generally need to follow the guidelines of these services in order to convert your image to the proper format.
Here's an example online service that will create the .ico image you desire. After using the service you will want to place the .ico file in the 'root' directory of your website and/or application. The 'root' directory means the very base directory in which your website files exist. E.g. your index.html or index.php file, etc.
https://www.favicon-generator.org/
In addition, you can explicitly reference your favicon via HTML meta tags. See this W3C URL for additional reference:
https://www.w3.org/2005/10/howto-favicon

Related

PHP filepath messing html links

I have an issue migrating a site where the links are all broken. It's a html site but uses php file system. The links in the index.html has \ in front of it. There's a file of php files like: Configuration.php, FileSystem.php, Bootstrap.php, Handler.php. How do I revert to just regular hmtl links.
Thanks!
If all you want to do is convert the dynamic PHP based website to a static HTML is easy.
Open the website in Firefox (Chrome will probably work too, but I did not test).
Go to File->Save Page As... and select a directory on your PC.
Firefox will then download the main file and needed dependencies to the PC eliminating all the PHP since it doesn't even know the server generated the page dynamically using PHP.
You can now deploy the site where ever you like.
Please note that if there are JS files that actively communicate with the server to download content dynamically you'll have to edit them yourself.

online editors for various file types, doc, dwg, image

I have a media archive with various file types on my server. If a user wants to update that file, he has to download the file to his local machine, edit it with his desktop software (Word, AutoCAD, etc), then reupload the file. It's kind of a pain for my users. Has anybody run into this problem and solved it in the past. I'm aware of using samba, but that's not exactly what i want. Are there any tools out there that can help me edit files that are on a server? I'm thinking kind of like a Google Docs kind of thing, your file actually sits somewhere in Googleland, but you can access and edit it in your browser. The files I would want to edit are:
.doc
.dwg (AutoCAD)
.jpg (is there a good image editing client out there?)
My language of choice is PHP, but I can do anything really if I have to.
The bottom line is I have a doc, for example, on my server in some directory. I want the user to edit the content of that doc and have it be replaced in place with as minimal hassle on the user as possible.
https://www.autocadws.com/ (CAD)
https://chrome.google.com/webstore/detail/dcjeclnkejmbepoibfnamioojinoopln (CAD)
https://docs.google.com (documents)
http://www.aviary.com/ (Images)
Online image editors are the easiest and most plentiful to find. You can roll your own half-baked version or use one of the API's like Aviary.
Google documents is very nice for the business side of things (Excel, Email, Word documents with multiple people working at a time).

converting a given file to PDF

hey all,
is there any way to convert a given file (this could be of any type) in to a pdf file in .net or php?
eg: suppose there is a upload link to upload your file of any type(word,excel,autocad,images..) and once the upload button is clicked the uploaded file should be converted into a pdf.
i checked out fpdf.but according to my knowledge all file types cannot be converted.a module to plugin to the CMS would also be fine.
FPDF does support images. I know because I have used it recently.
If you are wanting a pure PHP solution, you can use the PHP COM functions along with Word or Excel on the server to open up those files then copy the data out.
If I were you though, I would use Google. Load the doc into Google Docs then export it as a new format with the API.
There are a couple of 3rd party solutions available such as this one, which is optimised for use on the server and accessible from any web services capable environment, including .net. Supports loads of file types including MS-Office based documents.
Disclaimer, I worked on this product so consider me biased. Having said that, it works very well.

Pdf on web page: best solution

I need to include pdf files in some webpages, and I'm gettin' in troubles.
The app is a simple newspaper's archive, in which i can read right on page or download as pdf files, one file per page. What my customer can provide me is one pdf file for each page; what my customer wants from me is to navigate them in indexes (with page thumbnail) and have a read from a choosen one direcly in page; I'm using php/mysql.
I started trying out to use the <object> tag with type="application/pdf", but i found it's deprecate 'cause it's not crossplatform at all (there's no support on linux's browsers, but even my windows' firefox 3.5 couldn't show me anything).
I guessed I could transform that pdf in something different (html or simply images are good enough), but the only thing i found is ImageMagick, that I cannot use as I must install on server and I can't, as I'm not admin of that machine.
So, I'm finally looking for suggestions
Thanks
Display the pdf inline using an IFRAME. The thumbnail you can generate with imageMagik. You should be able to use the command line version of ImageMagik to resize and convert to jpg.
edit
Your best bet is to talk to the server admin and have them install php support for ImageMagik then you can use it as a class.
If you can't get support to install on the server, you will have to use the command line version.
You might be able to Google around for a library that wraps the command line, but it would be trivial to write it yourself.
With this in place you can create a large readable black and white png for each page. It should click through to the pdf.

How do I access a file's icon server-side via PHP?

I have a PHP script running that lists files in a certain directory on the server. Is there any way to access the file's icon metadata? Lots of issues with this I suppose (eg: depends on the OS hosting the script. depends on whether the file is using a custom icon. still have to convert the icn file to something that can be displayed in a browser) but any suggestions are welcome. I guess I could display a different icon depending on the file extension, but it would be nice to do it automatically.
You might be able to plug into the /icons folder that most apache installations have setup for their default directory listings.
It's not OS dependent at least.
You should be able to craft a url that displays an icon for a particular extension.
GDLib or ImageMagic possibly is that what you are looking for... But if you want to access metadata GDLib won't help. Not sure about ImageMagic.
Actually, you can create thumbnails with their help and cache them somewhere to avoid performance issues.
If you want to extract IPTC information from file you can use getimagesize function fith extra parameter.

Categories