How to download js file with webclient - silverlight-4.0

I have a javascript -> c# array parser that I would like to feed with some .js files from the internet, so what I'd like is to download those files and have the interpreter run them through. Only problem is that I can't do this since there is no crossdomainpolicy on the sites that I dl from, but I don't get why that should be an obstacle. I Can retrieve the js from just browsing to it in my browser, so why can't I retrieve the exact same text from code for further processing? how can I get to download the js files from the web?

Why don't you just upload copies of those js files to your website?
The cross-domain block is probably a function of the browser to prevent such actions that basically end up as phishing sites or some other kind of nefarious hack. But it should work just fine if you put copies of the js files on your own website.

Related

File upload WebSocket alternatives?

I'm currently try to find a solution to change WebSockets to an alternative way with less overhead for file upload. As far as I know, SSE can only download from the server, not reverse. Is there a solution to upload a file to the serve that is not WebSocket?
File upload has been part of the web since the dawn of time. (Okay, I'm exaggerating: form-based file upload was added as a supplemental to HTML 2, in November 1995: RFC 1867, if you are interested.)
The browser takes care of the encoding, and it will be as efficient as it can be.
Most server-side languages have some helper functions for dealing with the uploaded files. And there are client-side javascript libraries that will give you a more friendly UI than the basic html form. They are often using AJAX to give you an asynchronous file upload, that won't block the user interface.
If you search for "file upload using ajax" you will find plenty of tutorials and sample code.

How to handle pdf files from server response?

I am working on React-Native mobile app and I need to handle pdf file coming from the server. The idea is when the user clicks on button, a request to the server is made and a pdf file is returned. My question is how to download and parse this file and show it to the user?
You can do it in app BUT you are going to have a lot of pain, especially with android devices.
My advice is using the Linking api and open a webbrowser:
https://facebook.github.io/react-native/docs/linking
The idea is to check if your url contains a .pdf. You can use a mix of:
https://lodash.com/docs/#includes
https://lodash.com/docs/#filter
https://lodash.com/docs/#split
When you are sure that your url is a pdf, you can use:
Linking.openURL(url);

Can I upload files from a custom website form to Dropbox?

I have clients uploading files directly to my Dropbox folder. I was curious if I can build a website form that uploads the file to my Dropbox folder and also saves the forms data to my server with a reference to the file that was uploaded to Dropbox? They are legal documents and I don't want to worry about security if Dropbox handles that.
It looks like it should definitely be possible.
You would have to use the dropbox api:
https://www.dropbox.com/developers
https://github.com/dropbox/dropbox-js
There are some javascript examples that would likely be what you would need to go directly to dropbox without going to your server first.

access user arbitrary folders with chrome localstorage API

I'm developing an app on Google chrome which could be able to read and write files to arbitrary folders on the user’s hard drive, such as their My Pictures or My Documents folder.
I want my app to has its one folder, like "Users/Username/App", so users could be able to access some of the data, created and edited by the app. How can I do this?
I read the book "Using the HTML5 Filesystem API", so I know it's actually not possible with HTML5 Filesystem API alone. Same thing was possible by opera 11, 12. (see: http://dev.opera.com/articles/view/file-i-o-api-for-widgets/). Chorome mediaGalleries API do same things but just for media file but I want to use html, xml and office files
It doesn't sound like you've looked at the list of Chrome App APIs. Have you? Among them is the fileSystem API, which is evolving quickly to include directory access.

Get download URL from UIWebView for a media file

I'm building an app that comunicate with a Web Service and I'm trying to download files from it.
I found that, after sending an appropriate request to the server, if the link of the UIWebView contains "DownloadFolder", that's the correct download link; sending an async request with that url the download works well for files like .pdf .doc .xls and so on..
The problems came when i send a request for a media file like mp3 mov and so. The webview work well and display the player, but I can't get the url from the webview.
I also noticed that in the consolle is displayed a line like this:
setting movie path: http://xxx.xxx.xxx.xxx/WEBSERVER/DownloadFolder/NAMEOFWEBSERVER/ADMIN/FA29-12-2011-12-57-04-163pitorb45sluo0g455wwc3u55.mp3
That's the URL I want to use for the download. How can i get it from code?
Thanks in advance.