Open TFS Work Item Attachment in Image Viewer not Web Browser - visual-studio-2010

Is there a way to open an attachment for a TFS work item by double clicking on it (or rather just opening it from the IDE) in your computer's default image viewer, rather than opening it in a web browser? I'd love to be able to change this setting (if it is a setting).
Edit: after reviewing Kate Gregory's response, I looked into this option and realized that the trouble is that VS is launching a url (a handler file to respond with the attachment), which results in the default web browser being launched. A potential work around i'm considering is writing a custom mapper for all web based calls (as in, when going to start->run and enter a URL) that the mapper would determine what kind of call it is (TFS, etc) and use an appropriate program, based on the MIME type responded with, with a second phase to be incorporate this as a VS add-in.

I'm reasonably sure VS just uses your default program. Word for .doc files, IE for .htm files, and (in your case I bet) IE for .jpg files. Try changing the default program you're using in Windows and see what happens.

All files saved in TFS are saved in a path that starts with the following address:
http ://{YourServerName}TFS01:8080/tfs/.../.../...&FileName={YourFileName}.{YourExt}
This means that all files are opened using the default program defined for HTTP protocol, regardless of the extension for your file.
You can probably change the default program for your HTTP protocol (if you have permissions, and usually you wouldn't) but this would also affect opening any regular web page or URL, which is probably not recommended.
I still haven't found a workaround this issue too.

Some kind of preview function in VST/Team Explorer would be nice. Then, only a minor of attachments must be opened in the browser.
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6224713-preview-attachments-in-team-explorer

Related

How to make Firefox open RSS directly (like other XML files), instead of downloading?

Using Firefox 70.0.1 on Arch Linux. (I realize that this question might technically belong on SuperUser, but I suspect that no non-developer would ever need to do this.)
I'm trying to debug my code that generates an RSS feed, by viewing it directly in Firefox's XML viewer.
When I enter a feed URL, like https://en.blog.wordpress.com/feed/, Firefox pops up the dialog that asks me what to do with the file. It calls it an "RSS Summary", and I can choose to open it or save it to disk.
I can choose to open it in Firefox, but then the file is first downloaded to disk, and then opened from a file:// URL. The result is that I can't hit F5 to refresh it; I have to enter the URL anew.
This only happens if the Content-Type header is application/rss+xml. A file served up as plain application/xml (like e.g. https://xkcd.com/rss.xml uses) is opened directly.
How can I tell Firefox that application/rss+xml should receive the same treatment and just be viewed as a regular XML file?
Add the „view-source:“ prefix in front of your url as said in this article: https://css-tricks.com/snippets/html/view-source-of-rss-feed-in-firefox/
You should be able to achieve this using an extension.
There is Open in Browser which seems to resolve the issue.
When you try opening the RSS URL with the extension installed, you will be shown a window where you can choose which action to take. You can choose to open the file as XML in the browser window. If you want to be able to hit F5 and reload the file, you may also want to tick "Do this automatically for files like this from now on".
Note that I haven't read the source code of the extension so I don't know if it is safe to use or not.

How to start "save as / open" after requesting a file from server?

I'm using MooTools as JS-Framework.
When a user clicks the "Show Report"-Button on my website I'm starting Request.HTML to retrieve the path of the requested report.
If the report does not exists yet, its been created on the server (a waiting popup is shown to the user). The report file is saved to a special path on the server and this path is returned to the browser.
After I got the path to the Report-File - the Report can reach about 5 to 8MB - I want to show the user a "Download-ProgressBar" while starting a new Request.HTML to retrieve the big report file.
Everthing until this point works fine. I got the ProgressBar filling up, after its finished I got my big file.
But my problem is now, how I can start something like "Open File" or "Save File As" from JavaScript.
I got the freaking file downloaded and shown in the console but now I want the user to save this file somewhere or to open it directly...
Kind Regard.
Why don't just show a link to that file so that it opens in a new page?
That way one can open in a new window and save from the browser's menu (or use the right click>save to menu).
Since you already have your file serialized most browsers nowadays supports the data uri scheme so if this fine to support a limited subset of browsers you can do
window.open(fileToSave, '_blank');
notably old version of IE don't support all kind of files using data-uri so it will not work for html.
There are some File API in newer browser too, and there are some other solutions involving flash but historically the right way to do this is to navigate to a server page which returns an header
Content-Disposition: attachment; filename=yourfilename.html
that will work in any browser (I used this a lot in IE6 with no particular problem).

Customizable Windows right-click file uploader?

I'm looking for a "right-click upload" application like RightLoad - an application that can upload media files to a remote FTP server from the Windows Explorer's context menu. I want to customize the application to serve as a customized image uploading tool to a PHP-based CMS.
The user would upload images and other media files to a defined FTP account (I'm also very open for other methods of transport, as long as they are supported by run-off-the-mill web hosting stacks) that they could then use in the CMS they log in to.
For me to be able to do these customizations, the application would have to be Open Source - RightLoad is "only" Freeware. Alternatively, I'm open for closed-source and commercial suggestions as long as they allow "pre-packaged" server settings that can easily be deployed to the user.
Does anybody know such a tool compatible with at least the most current versions of Windows (XP, Vista, 7)?
Bounty
Thanks all for the great input. In the case at hand, I decided it's easiest for me to stick with RightLoad and create a workflow in which the URL presented by RightLoad after the upload is copy+pasted into the CMS. I am putting a bounty on this because I think it's a worthy question for future generations, and I want to be the first one to put up a 500 bounty under the new bounty system :)
You could just use the send to menu using window's My network Places like this http://techie-buzz.com/how-to/right-click-and-send-to-ftp.html
I think WinSCP might have everything you want:
Open Source under GNU GPL
Windows Explorer's 'Send To' Context Menu
Drag 'n Drop Shell Extension
lots of additional features
and it can be scripted and is more secure than FTP due to using SSH
If you insist on open source, why not create a custom context menu handler and send it using some open source FTP client?
I would have to check the details, if it's really viable, but I would start with it.
I just had an idea, tested and working:
use regedit to edit HKEY_CLASSES_ROOT/*/Shell
add a key in shell called FTP to Mysite, in the default value set it to FTP to Mysite.
then add a key to the FTP key you just created called command, in the command default value use:
C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.mysite.com?file=%1
what this will do is open IE and the address www.mysite.com?file=C:\path\to\file.jpg
now using $_GET you can get the file address, upload it via php to where ever, even add an interface...
now when the user right clicks on any file, they can upload it via your web site by clicking FTP
1) another software is RightLoad , i use it that this moment!
2) The nice software I used over years, was FLING. It adds Right Click menu in windows explorer... However, I have left the software, because till today (version 2.35) fling DOESNT support SFTP (And nowadays on all sites I use SFTP!!)
3) I DONT like SEND-TO menu! (because I think passwords saved in WINDOWS can be easily stolen by virus..)

How to get the last current or visited Web URL in Windows?

I'm writing a Windows app. where you can create "links", it is easy to link files or folder (just use the standard dialogs for open files or browse folders), but for linking a Web URL I don't know how to get (from a Windows function or registry key) the current or last visited page.
Maybe something like the recently used files, but referencing web pages (independent of the browser), could be useful.
There is no common browser independent place to look for the last visited pages from what i know(i'm saying this from my experience at computer forensic)
I know there is a place in the registry where explorer saves this info, and probably other browsers as well, you can find this info by using a tool like procmon by sysinternals.
Just enter a site and see what the registry writes down..
This might give you a start:
wrapper class for URL history interface in C#
I found it! (at least for IE)...
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs
Then, I should find the equivalent key (or maybe a config file) of the other most common web browsers.

Opening a file from TFS using the full TFS Path, from a web site

So I have a website running that displays full path of a TFS File on the page somewhere, I want the user to be able to click on it, which should then open up that file from TFS inside their Visual Studio.
The command to do this inside Visual Studio is "File.TfsOpenFromSourceControl" (DTE command) - it's basically the user manually going to that file using the Source control explorer and double clicking to open it up.
I am wanting to simulate that action from my web app inside the browser.
Update: The Web app is a pure ASPNet MVC app with Jquery available to it. I am already showing the file's content to the user in the web app. But I want the user to open the same file in Visual studio, by clicking on the file path in the web app. The question is more of Browser to VS integration and how to execute the DTE command in question, from within the web app context of the browser.
Any clues would be helpful
I don't know the answer to Pavel's question, so I'll sketch an outline of both solutions.
If you want to display the file inside the browser, call the Item.DownloadFile() API. NB: in 2008 SP1 there is another overload of this method that allows streaming into a memory buffer instead of writing directly to the filesystem. If you don't already work with Item objects directly, you can retrieve them via the GetItem() / GetItems() APIs.
If you want to make the file open in VS, there are a couple approaches. Perhaps your web app already includes the concept of local workspace(s) for the user, similar to Source Control Explorer. If so, you'd simply call Workspace.GetLocalItemForServerItem() to find the local path of the item, then ShellExecute it. (Or maybe pass it as a command line parameter to devenv.exe, if it's not natively associated with VS.) If not, you can either create a temporary workspace on behalf of the user, or use the same DownloadFile() API shown before; stream the contents to the client over a web service, save to disk, then launch VS as before.
Naturally, the more involved scenarios under option #2 will require deeper OS integration than the DOM / Javascript can provide. Would help to know if this web app is already built on ActiveX, Flash, Silverlight, XBAP, or similar technology...

Resources