Open PDF in MediaWiki - pdf

In my mediawiki, I can link to internal PDFs using:
[[File:test.pdf]]
But if the user clicks the link, a single page for this file is opened like:
http://localhost/mediawiki/index.php/File:test.pdf
How can I achieve, that the PDF file is opened directly with no other pages in between needed?

You can use the Media: pseudonamespace to link directly to the file:
[[Media:Test.pdf]]
This will link to:
http://localhost/wikimedia/images/d/d3/Test.pdf
The (slight) documentation about this is at: https://www.mediawiki.org/wiki/Help:Links#file-links

Related

Unable to make .vcf file download able

I am stuck in a problem while building a digital business Card on wordpress, Please help me out with this problem.
Problem
I want to add an option of save the card means save the cotact details directly by just clicking/hiting that button in my digital business card, For that i also created one dedicated folder in my Database for vcf file with the name of Uploads and in this folder i also paste a php file for vcard after guidning by the chat support of hostinger but that only works for that particular vcf file whose name is mentioned in the php but also it is only downloadable not importable (means when we hit the downloaded vcf file then an message apperas Contact couldn't import) and i want to add lots of vcf file so it means i need to add php files as well.
Solution Which I know of that problem
So to achieve this we need to add that vcf file in that upload folder, which i am doing, then we can create a link which is should be like that https://domainname/uploade/vcffilename.vcf. But unfortunatelly it is not happing through this link the coded vcf file available.
Can you please guide me what the thing i am missing here so that my vcf link works properly and i can also provide the save option.
Regards
Vaibhav Narang

cfdocument: open download prompt to ask user where to save pdf

I'm using cfdocument to create a pdf. Displaying the pdf in the browser works fine, but I would like to just open a download prompt when the user opens that url.
<cfdocument format="PDF" localUrl="yes" margintop="0.25" orientation="landscape">
What I tried:
I followed this and added a filename: https://community.adobe.com/t5/coldfusion-discussions/how-to-use-cfdocument-create-a-pdf-file-and-save-the-file-in-server/td-p/966276
But it just saves that file in a lucee temp folder.
What I want is that it opens a prompt and asks the user, where he wants to save that file.
I'm pretty sure you can't prompt the "save as" directly. The cause is that nowadays most browsers save the file immediately/directly to the "download" folder by default. For example in Chrome the user can deactivate this behaviour in "Settings -> Downloads -> Ask where to save each file before downloading". A similar setting exists in Firefox.
However, if you don't want to display the PDF in the browser but start a direct download, just add the http headers used for that. This is an example how to achieve it (
I've tested this on Lucee only but should work for ACF the same way):
<cfheader name="Content-Transfer-Encoding" value="binary">
<cfheader name="Content-Disposition" value="attachment; filename=""somefilename.pdf""">
<cfheader name="Content-Type" value="application/pdf">
<cfdocument format = "PDF" pagetype="A4" orientation="portrait">
Just a test for download!
</cfdocument>
If you omit the attribute filename="somefilename.pdf" of the Content-Disposition response header, the name of the url will be taken. Alternatively you could ask the user to specify a name in a form input field and populate that variable. But it still will be downloaded to the "download" directory as specified in the users browser setting.

Previewing files on web server?

I am currently browsing the files (mostly images) on our server using HTTP, in the most primitive way (a very inefficient way).
To quickly glance a file, I need to click on and open it. Then exit, onto the next file. Very inefficient.
Is there a way that I can preview these files without opening them, just like what we do on our Mac/Windows system.
You could use Fancybox to get both a thumbnail view, and to open images without leaving the page. You can configure Apache to display your directory as a gallery, and add in thumbnails of your image into the DOM.
Try the instructions found here. The demo on that page doesn't seem to be working, but the instructions do work. The instructions there don't cover adding thumbnails, but in my abbreviated instructions below I added in a step to get them:
Download Fancybox
Create a fancybox directory at the root level of your site, and add the files from the Fancybox download.
Create a fancybox.html file in the fancybox directory and load the Fancybox library and set the config options. See the example here.
(My addition) Add a line to fancybox.html to insert a thumbnail into the Apache directory listing. Here's just a simple line you might add after line 26 in the linked example file:
$(this).html("<img src='"+ $(this).attr('href') +"' width='200'>" + title);
Create a .htaccess file in your image directory (and be sure .htaccess files are usable by Apache)
Add these lines to the .htaccess file:
Options +Indexes
ReadmeName /fancybox/fancybox.html
Navigate to your image directory
You can modify the Apache directory listing page to make it as pretty as you like. See this article on styling the directory listing. Probably any other gallery library you like could be used with a similar method, the important thing is that the ReadmeName option lets you inject javascript and css which you can use to manipulate the DOM.

Redirecting Url to Local Host

My website items has pictures which were external links. Now I have bought all the images for those item picture and place into my directory inside a picture folder. I would like to know instead of changing individual item picture link is there a way to redirect old item link to new directory. Example
Old Link:
http://www.something.com/images/item_images/item28.jpg
New Directory Name:
images/item_images
I would like to capture "something.com" and change it with my own website link. like "mywebsite.com/rest_of_the_link". How can I achieve this?
I think you can do this using .htacces file in root directory, seee:
https://my.bluehost.com/cgi/help/htaccess_redirect
http://www.htaccessredirect.net
Or maby using virtual host in apache if you have access to ssh console.
https:// httpd.apache.org /docs/2.4/vhosts/examples.html

Sitefinity: Need to make a PDF available on a very specific URL but can't do it

I have a website on SiteFinity 4.4. I need to make a document available on a very specific URL, i.e.
http:www.example.com/reports/the-report.pdf
If I just create a directory in the root of the site it does not work (503 error). Also when I try to use the 302Redirect.xml file to redirect the URL to the PDF it does not work either (same error). The link has already been published and has to be exactly as specified. How do I solve this?
Any help would be greatly appreciated.
Sitefinity wouldn't block a folder. Adding a physical folder and dropping that report on the proper place should function, so it probably means you'll have to check your server configuration.
Anyway, the fastest way outside Sitefinity, would be to just create a IIS rewrite rule. Make the http:/www.example.com/reports/the-report.pdf the pattern and redirect them to the url of the document from the sitefinity library.
When you upload a document to the library in sitefinity it gives you an direct url, something like /docs/defaultlibrary/document. You can verify the url by going to content >> documents and files and chose Embed link to this file. That gives you a pop-up with the url.