Chrome and file system objects - file

I have been doing a lot of research and trying to find a work around for a problem I have.
I am working with old code. Classic ASP with VBscript.
The tool we have working is file system objects. A user uploads a file into the input and it then gets added to the companies fileshare file. The problem is that google chrome has decided to not support VBscript. I easily converted the VBscript to Javascript using activeX but that is basically IE. We got it working in chrome using the plugin IE tabs. But we do not want to use the plug in.
My question is, since javascript is read only and we are running classic asp as our server side language is there any way that we can implement a cross browser file upload?

Converting ActiveX vbscript to javascript to run in crhome will not work. The reason for this is browsers have a security sandbox which prevents access to the filesystem. If the file share is on the same server as the web server, you would have to process the file uploads server side through a backend language like asp, asp.net, php.

Related

Cannot generate JNLP dynamically from ADF (JSF) application

I have an application developed with Oracle ADF ( JSF ) that uses an applet to send PDFs directly to the printer without showing them to the user.
Since modern browsers (such as the latest versions of Google Chrome) apparently no longer support applets I have developed a swing application java replacing the mentioned applet, this should be distributed using web start.
The printing application is already developed , compiled into a JAR and signed , a first test with a static JNLP was apparently successful .
My problem is that the JAR must receive parameters sent from the website where it is invoked and I do not know how get this. I have seen some examples that extend the JnlpDownloadServlet servlet that is part of the examples of Java, but I could not make anyone of these examples work properly.
I use JDeveloper as IDE.
I hope someone of you can help me.
Thanks in advance.
I was having the same problem.
Following this link from oracle forum I was able to put it to work.
I only add to revise the jnlp tags and attributes when creating the file, like
String jnlpRoot = "<jnlp spec=\"1.0+\" codebase=\"" + codeBaseUrl + "\" version=\"0.1\">\n"; //href="PrintApplet.jnlp"
The href attribute was the one that was breaking the download functionality, it was expecting a file inside the application.
Hope this helps

Upload a large File to Sharepoint in a Silverlight application

I have tried what seems like about a dozen different methods of uploading files to sharepoint from a silverlight application. They either have severe limitations (file size limits of less than a meg or so) or lots of security issues that I have not been able to over come. I have tried:
WCF (We are trying not to use any custom WCF services at all FYI though this is the method that I have gotten to semi work)
Sharepoint Web services
Client object model
HTTP put
Webclient write stream
I have seen lots of different examples out there of people doing completely different things but none seem to work and all seem like they are the "old" way of doing things. I am using silverlight 4, sharepoint 2010 on IIS 7. Is there a best practice for uploading large (say 20-30 meg) files? I just want to dump a file into a document library.
I had similar issue. Tweaking web application level setting from central admin, changing asp.net limit in web.confit and following article helped me.
http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx
Just had a thought silverlight has a thing called an HTML Bridge which allows it to interact with the rest of the page. Consider calling a javascript function from Silverlight, and let the javascript function do the actual upload
UPDATE - the Javascript ClientOM doesn't seem to have the SaveBinaryDirect method :-(
How about doing some ExecuteQueryAsync and then in the success call back function (no longer on the UI thread), using the Microsoft.SharePoint.Client version of File? I know this would require downloading the larger assembly, so perhaps that's not so good.
I wonder if there is a way to get the clientOM use a more efficient binding when calling the web services...
Martin
The default upload size limit for the SharePoint client object model is 2 MB. You can change that limit by modifying the MaxReceivedMessageSize property of the service.
This can be done in two ways:
programatically - as described in this link - tho this won't work in Silverlight for example
trough the powershell. On the server where you have SharePoint installed, fire up the SharePoint Management Shell (make sure you run it under the farm administrator account) and run the following commands.
$ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$ws.ClientRequestServiceSettings.MaxReceivedMessageSize = 52428800
$ws.Update()
This will change the upload limit to 52428800 bytes - or 50 MB. Now, restart the website hosting your SharePoint site (or the entire IIS) for the changes to take effect.

Silverlight OOTB Support for 'Save File' browser dialog

I am in the design stage of an application that must be both a standalone app & a web application (To save the costs of building 2 near identical applications twice). Basically I have opted to go for a silverlight OOTB application that will be installed on the standalone machines and they will write to a collection of files in the sandbox and occasionally talk to the server version. The same application (with a little configuration) will also operate on the webserver and store its data in a database.
I am however more of a WPF developer so I would like to cover some concerns I have before I go too far down this path...these are:
I hear you can pass a file out for the user to 'Save As' in their browser when using SL normally. Is there similar functionality with OOTB? Because I want to be able to save some of the local files to locations other than the sandbox (With user permission)?
Is is possible to configure OOTB to allow access to the filesystem outside of the sandbox?
Is there a way to programatically determine whether a silverlight application is running in OOTB mode (So I know what mode the application should be running in)?
Are there any major flaws in my ideas so far that would prevent this from being a possibility?
Silverlight 4 will provide support for out of browser trusted applications, which have more privileges that a normal sandboxed application but still not as much as a regular desktop application. Regarding file access, a trusted application will be able to access to some predefined folders such as MyDocuments, MyMusic, MyPictures, MyVideos, but not the entire filesystem. See here for details: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/11/18/silverlight-4-rough-notes-trusted-applications.aspx
As for how to know whether you are running out of browser or not, use Application.Current.RunningOffline.
Finally, I recommend you to take a look at PRISM. Among other things, it eases the task of sharing code between WPF and Silverlight, so you could consider developing a dual SL+WPF application.

Do I need a local web service to connect to database for Silverlight OOB?

I've done some cursory reading on Silverlight and data access. From what I can tell, I'll need a web service to hook up a Silverlight application to a database while it's running in browser. Is this true when it goes OOB? Or is there another method that should be used then?
Some background:
We have a .Net 2.0 Winforms application. We're trying to convert the functionality to a web app of some sort without rewriting the business logic. Our internal web developers all write in ColdFusion, so Adobe Air seemed to be a natural fit. However, we've found out that the only way to consume a .Net dll in Air is to write an EXE that makes function calls. (Perhaps something like a WCF service on the local machine.) Since that's the case, I thought I'd see how the data access was in Silverlight OOB, because we will have customers with limited-to-no internet connectivity and will need to be able to access an offline DB.
As far as I know, whether it runs in or out of browser it will need a web service or other means to hit a database. You cannot do it through the Silverlight application because of the sandbox security model used.
In 4.0 there is the added use of COM so you may be able to use that to your advantage.
Otherwise you would just be using a file stored in IsolatedStorage to persist data to, like an XML file for example. Maybe this is what you are looking for though?

Silverlight 2.0 - Saving to a text file

I'd like to save some simple text data to a file from my Silverlight app - to a CSV file.
The user presses on a button, the code generates the contents of the file in memory (a string), then a prompt appears asking to either open the file or Save to disk, like through a normal web page.
I found a complicated way to do it:
http://pagebrooks.com/archive/2008/07/16/save-file-dialog-in-silverlight.aspx
But wondered if there was a simpler way? Especially with the recent release of Silverlight 2.0.
Thanks.
Right now Silverlight 2 doesn't support saving directly to the user's disk even with a prompt. It is a feature being considered for future versions, but the work around of having the server push out the data is the current solution.
Just to update this thread -- Silverlight 3 has this capability now.
I do this right now with Silverlight 2.0, but the key is that the files are saved on the web server that hosts the Silverlight apps, by having the Silverlight app call web services.
Probably not what you are looking for, but this is an option.
Silverlight app calls web service, that posts the string
Web service saves the string as a file on the server
File is available through web app, or other means

Resources