is it possible to redirect a link to a pdf file - web

is it possible to redirect a link to a pdf file?
This is my site: www.mysite.com
And I createad a redirect link that if I open www.mysite.com/documentation - an index.html file will open but for now this index.html file says it's under construction.
Can I redirect the link to a pdf file?
I uploaded the pdf file into the server. So that if I open www.mysite.com/documentation, my pdf named as thedocument.pdf will open.
Is it possible?

If your web hosting provider won't allow you alter the default extensions (i.e. to add pdf) then you could create a HTML page to act as the landing page and then redirect to the PDF.
Details here: http://www.web-source.net/html_redirect.htm

Yes, this is possible. Check your web server configuration that currently points /documentation to index.html, and change it to point to thedocument.pdf.
Be aware that the PDF may or may not load in the user's browser. Some configurations will prompt the user to download the file.

You can achieve this with a modX Weblink.
Upload your pdf to a place from where it is publicly downloadable. For this example I will upload it to modx/assets/content/test.pdf. You should now be able to download your file from http://yourdomain.tld/assets/content/test.pdf.
Create a new weblink resource in modX (Site -> New Weblink) on the base level of your resource-tree. Make it a container and type in 'documentation' as the alias of your resource. You should also make sure, that you already use friendly urls, but your question sounds like you're already doing this.
A weblink has a field to enter the 'weblink' instead of the ressource content. Just use the URL from which you are already able to download your pdf-file. In this example, this would be http://yourdomain.tld/assets/content/test.pdf.
If you now view the newly created weblink resource under http://yourdomain.tld/documentation, you should instantly download a copy of your file test.pdf.

Related

Adding HTML from an internal file to a Web Part on SharePoint

I have developed a SharePoint Web Part where I have an iframe that I need to load with several pages depend on different values.
For instance, I have this files
file1.html
file2.html
file3.html
And I need to pass the path of one of this elements to an iframe
Where can I put this files and How can I retrieve the right path of this pages?
Regards
Try to save the html files in a library and set the iframe url dynamically.
$('#iframeId').attr('src', url)

How to prevent website being grabbed by IDM( or anyother webstie grabber)?Is there any way to prevent it?

Using website grabbers whole website with folder structure can be downloaded.
Is there any way to prevent this?
If so,how?
The only way to protect a websites markup is not to publish it. If you want your users to see something they need to get the HTML markup and the images, that should be displayed. And therefore the files need to be accessible. And if your files are accessible every user/bot/crawler/grabber can save these files.
The best way is to put a few files like the index page in the main directory and call the other sub pages in it. If using php then you may do the following.
Say keep the index.php in the main folder and keep the homepage.php in a directory called includes and use the homepage in the index.php via include function in php.
Now add a .htaccess file to the includes folder which must contain
"deny from all"
This way users can use the page but will not have direct access to the files. So will be for the grabber.

A link to the text file downloads it rather than opening it in browser

In my webpage I have a link to a text file something like this.
Link
When I click on the link the browser downloads the file rather than opening it in the browser.
can anyone tell me how I can do this. Is there any browser changes I need to make..? The link actually is a direct link to the text file itself, and not redirecting the request from a different page. Thanks in advance.
check the HTTP headers that are being used to serve the file, you many need to
fix the server so that it uses the correct mime-type and disposition when serving the file.
If the browser doesn't recognise the type or sees "Disposition: Attachment" it will save the file.
Either change your file to .html or change your webserver mime-type settings to display .txt files.

Get link to file I uploaded to DNN Website

How do I get a link to a file I have uploaded to my website?
I have uploaded a file to my website by going to Admin - File Manager then I uploaded the file to this destination *Portal Root\Pages\Customisation* how do I then get a link to the file I just uploaded?
The file is myFile.PDF so I have tried this path but it doesn't send me back the file:
http://mywebsite.com.au/Pages/Customisation/myFile.pdf
The "portal root" is typically housed in the directory "Portals/0," so the full URL would be http://mywebsite.com.au/Portals/0/Pages/Customisation/myFile.pdf. If you have multiple sites/portals within the DNN installation, that you'll need to find the ID, instead of assuming that it's 0.
There's also a small possibility that the home directory has been customized to some other directory name entirely. But you can verify the directory on the Advanced Settings tab of Site Settings, in the Page Management section.

How to protect my site user file from a website downloader

Hi suppose my site as www.xyz.com and i have a folder as _Userfile which have file uploaded by my users and if they download there file the link is www.xyz/_Userfile/userfile.doc now i want to learn this:
if some one has the link to other user file he can download it i want to solve this(privacy)
2: protect my site file from website downloader.
ASAP plz
Also i am using virtual directory to save my user files so i need a way to protect any type of file to be downloaded by any kind of software
You'll have to implement an authentication mechanism, and to serve those files through a server-side application (in PHP, Java or whatever), that checks if the authenticated user has the right to access a resource, then reads the resource from the disk and writes it to the HTTP response. The documents should be placed in a location that is not directly accessible through HTTP.
Just add index.html file in the folder _Userfile... This will prevent others accessing the whole directory listing in _UserFile folder! Simple isn't it?

Resources