Sharepoint online (Office 365) : CEWP - html

While trying to provide Content Link for CEWP to a html file/text file, I am getting error "Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator." On clicking the "Test Link" button, the page opens in a new page. I have tried the following, but not resolved.
I have tried on moving the file to shared documents.
I have changed the extension .html to .txt
Confirmed that, logged in user has permission
Kindly share suggestions or way to resolve this issue. Thanks!

May be you are using relative path. Specify absolute path to file. Sometimes it is only way to resolve similar issues.
Do you have any whitespaces in url? If yes then replace it with %20. May be it is your case.
Is file located in same site collection? If no then locate it in current site collection.

Related

Open html file in a new tab instead of downloading it

For my Trac plugin, I have made an export script which converts contents to a different format. The result is an HTML code.
When I click the link, some browsers open the HTML code in a new tab, while others offer to download it as a .print file, depending on their specific settings I think. Opening this .print file shows the same HTML page as opening it directly, but locally instead of from the server.
How can I force it to always open in a new tab?
I think it might be a mimetype issue. If it is, which mimetype can I use to tell the browser to open the HTML code directly? I am currently using text/html as mimetype.
EDIT: some more info
To give some more insight, adapting from a comment of mine below:
I do not create the link myself. The link is provided by Trac, the bug tracking software the plugin is for, and what I do is implement the method that creates the HTML code and let it return the HTML code along with the mimetype. Trac then returns the HTML code either as a file, or as a new tab, when clicking on that content conversion link. What I am searching for is a possibility to specify in the HTML code or mimetype that it gets opened in a new tab directly.
Maybe there is some kind of mimetype specifying the (HTML) text as an HTML web document instead of HTML file (if that distinction even exists).
Or an HTML/XML header or doctype specifying whether it gets downloaded or opened by a browser. I think the browser need to get that information from somewhere.
Or maybe there is an option to set in Trac.
I hope these ideas of mine about what could exist can help those of you who are versed with either or some of these to find a solution. I could not find a solution through my research yet.
If you have a link that "directly" opens (not in a new tab) and you want it to open a new tab, one way of doing it is
This will create a blank page, then paste the link there automagically and thus you will have a new tab with the desired page.

How to make PDF from GitHub open in new tab?

I have a pdf file in a GitHub repo and an anchor tag that points to it (<a href="https://github..../file.pdf>link</a>) and when I click it, i download the file automatically.
How to make it open the PDF in a new tab, before downloading it (to the file system, just downloading it within the browser)?
I've tried adding target="_tab" and target="_blank" to the anchor, but all got me the same results?
Is it achieable using just HTML, or I need to use an external JavaScript library?
You shouldn't need to add target="..." whatsoever. I guess you're pointing to the wrong URL. GitHub provides access to the raw file through this URL pattern:
//github.com/<account>/<repo>/raw/<branch>/path/to/file.pdf
Note the raw part in the URL. Check if you got your URL right. A functional example:
Test PDF
You can test it clicking this link. A dialog will open asking you to specify where to download it.

How to Edit .Aspx Files?

I am trying to edit the following page: http://tktruck.com/contact.aspx in order to get rid of the cat photos.
Apparently there is no contact.aspx file in the FTP, so I am having trouble figuring out how to edit this page's content.
Some additional information:
I have access to the back-end (FTP files). I have searched the FTP for contact.aspx, and I cannot find the file. I have tried searching the entire website for tags with the appropriate sources, as well. I found some code with the image tags, and removed those tags. When I uploaded the code to the server, the images were still there (and still are).
Does anyone know what I have to do to edit an aspx file, or at least have an idea on how to remove these photos?
You need to get access to the server in which the website is hosted.

The links to .xls files will not work on my intranet site?

I am currently building an asp intranet site.
There are various helpful links that I need to include and some of them happen to be .xls files that are located on a local network within the company.
I link these documents just like I would any word docs (which work fine by the way).
<span>Schedule</span>
The link above works if I simply copy and paste the raw address into my browser (a pop-up window comes up asking me to open the file in Excel). But when I make this a link on the intranet site and try to click on it, nothing happens. I can see the link when I hover over it on the status bar but that's it. It is non-clickable. Anyone have any idea what is causing this and how to fix it?
I should mention that two of these .xls files are password-protected but one of them is simply a read-only file which can be opened by anyone.
I am 100% sure this has nothing to do with css styling because the same thing happens in the current (old) intranet site made by someone else and I use these links on different menu bars as well.
I think you use wrong syntax for shared files, try this:
file:///P:\-Projects-\SCHEDULE.xls
Backslashes are still valid for the path part. Moreover, I'm not sure whether Sharepoint may recognize correctly path to most likely network drive P:.
For me such link to local share works:
file:///\\fs-1\Install\Windows\Servers\DB\MSSQL\SQL2005\en_sql_server_2005_service_pack_4_x64.exe
The solution to this problem is to add the site to the "Trusted Sites" list.
Opening intranet files without the user knowing is considered a secruity threat.
In IE go to Internet Options -> Security -> Trusted Sites then add the site.
http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/after-latest-update-ie-wont-open-network-file/172e4ac3-1c1f-4948-8a3f-c8c344eae06d

Trouble Self-hosting a chrome app

I've built a Google Chrome Web App for my blog and want to host it on 000webhost. I have a direct link to the .crx file and when the user clicks it, it downloads the file and tries to install, however they get this error: "Apps must be served with content type application/x-chrome-extension". Now after doing much research, I still am not sure how to fix this, I tried adding a meta tag to the head section of the page with the link, I then tried using a PHP header on the page with the link
header('Content-Type: application/x-chrome-extension');
However that did not work either, I then tried adding this line of code to the top of my .htaccess code:
AddType application/x-chrome-extension crx
And you guessed it, it didn't work. I'd really appreciate some help with this, I don't want to pay the $5 just yet, I want to see if people think that it's worth bothering with the app, but I can only do that if my users can download the app!
PS, I get the same error message every time.