Change file extension in SharePoint - sharepoint

I'm trying to find out how to change the file extension of a file in a document library in SharePoint, so that a newer version with a different extension can be uploaded without a separated copy being created (e.g. suppose I want to replace a .doc file with .zip).
Looks like you can write some codes to workaround but I feel there's gotta be a simpler way to do a simple task like this.

You could change the extension by opening the library in windows explorer.
Actions - Open In Windows Explorer
Then ensure that in your file view settings you don't have 'Hide Extensions for known file types' enabled.

Related

Select file destination CrossFilePicker.Current.SaveFile(fileData) Xamarin Forms

I'm using Xamarin.Dialog.Plugin.FilePicker to pick a text file, and it works for me, but when I want to save a text file using CrossFilePicker.Current.SaveFile(fileData), a file destination picker is not openning.
Any sugestion to save a file on a destination from my choose using Xamarin Forms?
I think the SaveFile() is not doing what you expect. When you look e.g. at the Android implementation, it only saves the file to the external storage folder for the app. It's not meant to open a "save file" requester.
The real solution depends on your use case. If you want to open the file in another application, you have to implement a ContentProvider and open a content:// URL that your app handles, by using Intent.ActionView or similar. There currently is no Xamarin Plugin for doing this.

Launch an add-in systematically when opening a file

I want to make an Excel Online file, then post its link or embed it in my website. Clicking on that will open the file in Excel Online. Moreover, I want certain Excel add-ins to be installed and even launched automatically.
Does anyone know if it is possible?
If it's impossible with Excel Online, is it possible for a normal .xlsx file (I will make it, and opening it in Windows systematically leads to install an add-in and even launch it)?
If you're looking to automatically open a task pane add-in when the Excel file is opened, check out this article in the documentation: https://dev.office.com/docs/add-ins/design/automatically-open-a-task-pane-with-a-document?product=excel. The Office OOXML EmbedAddin sample provides an example of implementing the autoopen functionality that's described in the article.
Along with Kim's answer to automatic opening of a task pane add-in, you can using OneDrive to handle opening a file in Excel Online using Microsoft Graph.
You're start by uploading you're .xlsx file to OneDrive using an Upload Session. Once you're file is on OneDrive, you can retrieve it's meta-data for the DriveItem. Included in this meta-data will be a webUrl property. This is a URL that, when navigated too, will open your file using Excel Online.

Replace media in media library

Is there any way to replace a file in the media library in orchard 1.9.x through the administrative UI? I can go into the file base and replace the files, but I am hoping to find a way that content editors can go in and replace a file using the same URL without having to delete the current file first.
There is a recent pull request adressing the replace issue. You could download the changes recompile Orchard to get the replace functionality.
https://github.com/OrchardCMS/Orchard/pull/7160

Excel template in sharepoint - how to open as a new file from template?

I need to place an excel template in sharepoint and give people a link to it. I would like to prevent users from changing the template. I do not want users to save any file in the library. There are couple of solutions:
- revoke people sharepoint right to change the file,
- keep the file checked-out to me.
I also think about other scenario. Currently file is in .xlsm format (macro enabled workbook) but I am thinking about .xltm (macro enabled workbook template) as a way of forcing client excels to treat the file as template only. It looks like excel stubbornly wants to save the file (downloaded from sharepoint) as a template in source location and not as the new file. Only when I open the template directly from my local drive do I get what I need.
How do I force sharepoint/excel to use .xltm file stored in sharepoint as a template for a new file?
Isn't it a matter of incorrect http content disposition header?
If you reference the template file using a file path rather than the HTML path, it should open as a new document, rather than opening the original template e.g. use
\\SiteCollection\Site\DocumentLibrary\Template.xltx
instead of
http://SiteCollection/Site/DocumentLibrary/Template.xltx
In some cases making your Excel file a template for a content type or a library will do want you want. If you set some document library a template file this way all your new files in this library will be created from this file. Check out the Advanced Settings of a document library. There is a section Document Template that does the trick. If this section is disabled then your library has Content Types Management enabled and this means that you have to check the Advanced settings of a content type to set the template.
This solution makes all new files be created in the document library but not on a desktop but if you can live with that please be kind to mark as an answer.
If you want a link that can be sent out using mails you can use:
http://SiteCollection/Site/_layouts/15/download.aspx?SourceUrl=%2FSite%2FDocumentLibrary%2Template%2Exltx

how do I mark a file as a data file in a visual studio 2010 vsto clickonce application?

I'm making a Word 2007 add-in with C# 4.0 in Visual Studio 2010. I need an Access 2007 database (a .accdb file) to be placed in the data directory by the clickonce installer. Unfortunately, the file is getting put elsewhere, so the application can't find it at runtime. I've seen various articles refer to using the Application Files dialog on the Publish tab of the project properties to mark the file as a data file, but I have no Application Files button for some reason.
Any idea how to make the Application Files dialog appear, or some other way to manually mark my .accdb file as a data file?
In the Solution Explorer, if you set the file's property to be Copy to Output Directory = Copy Always. Then when you go to Application Files they should default as a Data File.
However, since this is your database I would consider looking at make it safe across updates so you might consider this post.
See http://msdn.microsoft.com/en-us/library/dd465298.aspx
By the way, "Application Files" button should be on the project properties' Publish tab.
VSTO Applications do not have the Application Files button available, and you can't set the file types specifically. If your file is not being deployed to the data directory and you want it to be, rename it with a file extension that is marked by ClickOnce as data. This includes .xml, .mdb, and .mdf. Otherwise, the file is deployed with the VSTO application and will be in the same location as the rest of the files.
The location of the deployment files for a VSTO application can be discovered programmatically this way:
System.Reflection.Assembly.GetExecutingAssembly.CodeBase
You might want to move the database, though, because unless you deploy it as data, it will be lost when an update is performed. Or you can check out this article about where to put your data to keep it safe from ClickOnce updates.
I was able to get things to work by using the Mage tool as described here:
http://msdn.microsoft.com/en-us/library/6fehc36e.aspx
The trick with MageUI is it's open file dialog assumes you want to open a manifest associated with a .exe; a vsto project has a .dll, so the manifest doesn't appear in the files list by default, which was really tripping me up.
Basically, this process is a pain because you have to remember to do it manually. I don't know if there's a way to make this part of the build (maybe a post-build step? But this is really a post-publish step).

Resources