How do I identify respective file viewer is present in client machine? - asp.net

We have developed Asp.net web application, Here we have uploaded the DWFX file. In one if the UI we have managed the uploaded file.
In this ui user will select the file name then we have provided two options like download and view, When user clicks the "download" option then file will be downloaded via browser.
When user clicks the "View" button then we have to open the DWFX file via browser. if client has installed the DWFX viewer in his machine then it is works fine otherwise it shows the blank browser screen, Instead of showing the blank screen System should tell to user like "DWFX viewer not installed this machine".
How to identify the DWFX viewer installed or not in client machine? or how to achive this requirement.
Thanks
Mayil.M

Short answer, You don't. You just have display instruction on your site that they need the free DWG TrueView software from Autodesk.
Long answer, you write an ActiveX control or a Java Applet that check if the required software if already install. And the user would have to grant your little utility the proper permission.

Related

How to get view any file functionality as we get in gmail using asp.net

I have to create code to view any type of file in the browser as we are able to view in gmail.
Even though the user does not have the required software installed he should be able to view it.
The file should not be open in separate window.
The file should be opened in the browser itself
Thanks in advance
You'll need to process it on the server-side into some data structure that can be rendered in html/css/js on the client

Can I make the download dialog box appear without "save" option?

I have a hyperlink to an executable like so: Run Now
I'm trying to make the download dialog box appear without the save function as it is to only run only on the user's computer.
Is there any way to manipulate the file download dialog box?
FYI: Running on Windows Server '03' - IIS.
Please no suggestions for a WCF program.
Okay I found it for anyone stumbling upon this conundrum in the future.
Add the following tag to your head section: <meta name="DownloadOptions" content="nosave" /> and the file download dialog box will not display the "save" option.
For the user to not open/run but save replace "nosave" with "noopen"
Not unless you have some control over a user's machine. If your application can run on limited resources, you might want to consider doing it in Silverlight.
IMO, having a website launching an executable is a pretty bad idea.... even worst if that website is open to the general public (not on intranet). I don't know what that app is doing but it sure is NOT, 1) cross browser, 2) cross platform, and 3) safe for your users.
If you are on intranet, you might get away with giving the full server path (on a shared drive) to the executable and change security settings on your in-house machines.
Other than that, you won't succeed in a open environment such as the Internet.
From your comments, if the user downloading the file is the issue, then there's no way to get around it, as they have to download the file in order to be able to run it.
There's any number of ways to get around whatever you could manage in browser, from proxies like Fiddler intercepting the data, or lower level things like packet sniffing. Or even simply going into the browser's temp/cache folder and copying the file out once it's running.
You could probably get around most laymen by having a program that they can download that registers a file extension with Windows. Then the file downloaded from this site would have the URL of the actual data obfuscated somehow (crypto/encoding/ROT-13/etc). The app would then go and grab the file. The initial program could even have whatever functionality provided by what you want to download, but it needs the downloaded key.
But this is moving into the area of DRM and security by obscurity. If an attacker wants your file, and it's on the Internet, they will get the file.

How does one print external files (XLS, PDF, DOCX, etc) from ASP.NET?

We have an application in classic ASP that allows user to 'attach' files to information. These can be PDFs, spreadsheets, Word documents, etc.
In the new ASP.NET version, one requested option was for a "Print All" (one user has a situation where there are 34 attached files and, in the current system, she has to open and print each one individually).
The files are kept in a separate directory - not embedded in the database. The database simply contains an ID number and the file's extension so the application would then go out and open "2182.xls" if the user wanted to see it (which would open an Excel window in that case).
Is there a way to send a file to a printer when all you have is the fully qualified filename? (Which I could presumably repeat 34 times in the above example)
Thanks in advance.
Remember that your asp.net code runs on the web server. It's not running on the client computer and has no knowledge of what printers (if any!) are installed there. That's just the way the web works; by design, all a web app can do is open the print dialog for the current page. Anything more, and hackers would use our web browsers for the same kind of spam you get at a fax machine.
That said, there might be some things you can do:
Add an activex control, flash app, silverlight app, firefox plugin, or other plugin code to support the feature.
Render all the attachments on the server into one html document with appropriate styles and javascript so it prints correctly and prompts the user on load.
If this if for a local intranet site (as opposed to public internet) where you have special knowledge of what printers are available for the current user, you could setup all the printers on your server and have it print to the correct location on behalf of the user.

Browse Server Folders in Client

I have a requirement for an admin user to set up an export directory on the web server, or relative to the web server using a UNC. Is there anything already out there that I can use for this, or must I recurs a limited directories and populate a home-rolled directory browser on the client?
I noticed this today ...a JQuery File Tree plugin. The link includes "connector scripts" in a number of server side languages including asp.net:
http://abeautifulsite.net/notebook.php?article=58
Looks awesome (and well documented) but I have not tried. I would love to hear feedback if anyone has...
Every solution to this problem I have seen is a home-rolled implementation of directory browsing.
When attaching a database on a SQL server, Microsoft uses a "custom" treeview to show drives/folders/files available to be attached.
Also, on DotNetNuke (an Open Source ASP.NET Content Management System) they have a home-rolled implementation as well for uploading files to Portal Folders...

How would you allow users to edit attachments in a web application?

We have created a web application, using ASP.NET, that allows users to upload documents and attach them to business entities, like customers, contacts and so on.
The application runs on the intranet and all files are uploaded through the web application into a shared folder on the server.
I would like, right from the web page, for the user to open the actual file, edit it and then save the changes back to the original location. This is a piece of cake in a Windows environment, I'm just wondering what, if any, is the best way to handle this in a web environment?
The files are usually Word documents, Excel documents and images.
Clarification
We would display all the attachments in a list format. We would like it so that the user would click on an edit link and the file would be opened in the appropriate application, for example, Microsoft Word or Microsoft Excel. I think the file associations in Windows would already handle this. We are just trying to save our user the time to download the original file, make their changes, delete the old file, and the upload the new file.
SharePoint does this by exposing FrontPage extensions which Word and Excel know how to deal with.
If you want to look at a commercial product for ASP.NET that allows you to edit images with AJAX (no need for installed software), I work for a company that has one (Atalasoft)
WebDAV is probably what you want. (Free)
If all your client computers are Windows, map a shared folder on the server to the same drive letter on every client and use the file:// format.
Let's say you share \ServerName\ShareName to H: on every client's computer, the you can make the link as file://h:\pat_to_the_file_under_your_share\fileName.doc
If not every one of the client's computers are in Windows, then you might try to make your links as follows (not sure if ot works):
file://\ServerName\ShareName\pat_to_the_file_under_your_share\fileName.doc
I'm trying to do something with using file:// instead of http:// but it's real sporadic based on the browser. Seems to work fine in IE, okay in Firefox, and goes nowhere in Chrome.
Looks like I may just be stuck with downloading, editing, and re-uploading the document.
It sounds like you want something similar t eRoom, where the browser works in conjunction with a component that intercepts a stream from http, stores it in a temp folder, then fires up Word or Excel and allows you to edit the stream.
You may have to create a component that will intervene and create a temporary local copy of the file.
This tool should do what you need.
http://www.dlitools.com/dlitools/dlitoolsHome.nsf/0FA6B8B31F831F468525736B0001C606/4BBD7E8684EA8DB78525754E006C63A3?OpenDocument

Resources