Selectively uploading files to a website - asp.net-mvc

My office uses a piece of software that generates XML based reports. These reports also reference images files which are created during the generation of a report.
I'm trying to develop an ASP.NET MVC web app that will allow users to share and collaborate on these reports. The site will read the XML data into a database, as well as store the images files to be viewed on the site.
However, the problem I'm having now is the reporting software generates many more images then are actually needed by my site. After reading through the XML report data my site will typically find that it really only needs a few images uploaded out of all images that were exported by the software.
I don't want to waste bandwidth or time by having the user upload every single image to the site, as most would end up just being deleted after the site reads through the XML file.
Is there any other way to allow a web-app to selectively upload files from a users computer? Ultimately I would like for the site to be able to read in the XML report file, determine what image files it needs, and then proceed to upload only those images.
Could this be accomplished through java script in the page? What about a silver light?
I know I could develop a stand alone executable that would handle parsing the XML and uploading the images. But I'm trying to avoid requiring the user to install anything to use this site.

unfortunately for security reason it's not very easy to have a web app access the local drive and copy files to the server. However, here are some suggestions:
Create an activeX that has full access to the users computer. (IE Only, has to be installed) basic activex, old example to upload files.
Create an applet, similar to ActiveX (cross browser). Example
Completely different idea, but maybe a bit simpler, you could have the user upload the xml, the server would determine which images it needs and display it to the user. The user could then do a multiple file upload of just the files you listed.
Best of luck.

Related

How to print documents and spreedsheets from google drive

I can't seem to find information on how to print files through google app script.
I found an answer in this website but it doesn't work, I think it's because it's 3 years old and google script has had some changes.
google app script print button
You can't print directly from GAS (I've searched far and wide), as described in the post that you linked. However it is possible to create a downloadable document with the desired content and then pass that blob off to the client for downloading (depending on wether you're still working in GAS or a web app environment).
Personally, I felt that it was a headache to deal with how each browser deals with downloading blobs. Therefore I usually go one of these two routes: provide a public downloadable link from the drive of the owner of the script and then push it to the user to download, OR just email the document to the user and let their email client handle downloading the blob.
Alternatively, if this is an add-on, you can make it so that the document is downloaded directly to the users own drive and just inform them where the document will be located.

Download entire website

I want to be able to download the entire contents of a website and use the data in my app. I've used NSURLConnection to download files in the past, but I don't believe it is capable of downloading all files from an entire website. I'm aware of the app Site Sucker, but don't think there is a way to integrate it's functionality into my app. I looked into AFNetworking & ASIHttpRequest, but didn't see anything useful to me. Any ideas / thoughts? Thanks.
I doubt there is anything out of the box that you can use, but existing libraries that you mentioned (AFNetworking & ASIHttpRequest) will get you pretty far.
The way this works is, you load the main website. Then you go through the source and find any resources that that page uses to display its contents and link to other pages. You then need to recursively download the contents of those resources, as well as its resources.
As you can imagine, there are few caveats to this approach:
You will only be able to download files that are mentioned in the source codes. Hidden files or files that aren't used by any page will not be downloaded as the app doesn't know of their existence.
Be aware of relative and absolute paths: ./image.jpg, /image.jpg, http://website.com/image.jpg, www.website.com/image.jpg, etc. could all link to the same image.
Keep in mind that page1.html could link to page2.html and vice versa. If you don't put any checks in place, this could lead to an infinite loop.
Check for pages that link to external websites--you probably don't want to download those as many websites have links to the outside and here you downloading the entire Internet to an iPhone with 8GB of storage.
Any dynamic pages (the ones that use a server side scripting language, such as PHP) will become static because they lose their server backend to provide them with dynamic data.
Those are the ones I could come up with, but I'm sure that there's more.

Reporting Service for Amazon RDS?

I'm curious if anyone has any leads for me on this:
I have a business app that we're building, that could benefit from some out of the box reporting services. Looking for reports that can be created and customized by the end user, without (too much) developer support. Think crystal reports / MS Access reports, but better and all web based interface.
Ideally, this would be a SAAS that I could buy, and that could hook directly up to my Amazon RDS instance. Then I would create frames around it within my business app for the end users.
I don't want to write my own reporting system - but I need it to be in the cloud to work with my system. Or be something I could install on a rails app.
So far, all I've found are brochure pages for services I've never heard of or developer solutions for rails on github. (meaning they have great report creation tools, but no front-ends for users.)
If anyone has any leads, or experience in this, I'd be happy to hear it.
Thanks
Docmosis.com
This is a cloud based reporting system developed for exactly this problem. It uses either Word or Open Office templates that can be edited and maintained by the end user with little or no developer support. There is a front end interface for the user to manage and upload their templates. Changes to the templates are reflected in report output instantly. Once deployed, your application simply calls the web service with the data to inject into the report (JSON, XML) which is then delivered back in a variety of formats including pdf, doc, html.
We have used this in the education sector for some time and found that it saves us a lot of time because the business owners can take on the task of developing the report formats in familiar MS Word and they prefer it that way.
I also know of a developer who has built an iPad app over it too. Docmosis streams pdfs back to the device and emails a copy to a specified email address. You can integrate it from most environments.

I need to take screenshots and upload to a webserver, what technology should I use?

I am building a peice of software that needs to allow a user to take a screenshot of his/her computer which will then be uploaded to a web server.
What technology should I use? I don't think js has access to the appropriate resources, but would like to keep it browser based. Help?
nope ... javascript won't work ...
you need some lib which takes a screenshot and another one which does the upload.
in .net there are builtin libs for both (taking screenshots, upload via ftp)
edit:
choose a technology which is able to create a screenshot and post it to an external resource via POST (or upload it via FTP). therefore you will need some access to local file-system ... well ... what would you think if you, as a novice, get prompted to allow access to local-filesystem (or network-resources)?
edit2:
as far as i know, silverlights support taking screenshots ... and there would be some ftp/post action included as well ..
Javascript by itself cannot handle this, nor should any webpage based technology --- if a website could covertly upload files from it's visitor's computers, it would have great hacking capability. Similarly for doing things like automatically taking a screenshot -- That's too much control for a user to give up to an unknown website.
So, any means of uploading a file will requires directly user interaction. With that, a simple HTML form with a <input type="file" /> element should be all that is needed.

Storing images for multiple web sites

I've got two web sites (written in c#) which are pretty common:
One is an admin site (cms) where you add images into content as needed, through editor pages.
Second is the site where the content with images is shown.
Images should be stored outside these two sites but where and how?
You could store them on a third site for static content, then both sites would link to that content. That can give you some benefits if you really need scalability as well.
However, you may also store it in a shared database, or just a shared file share, that you have encapsulated logic that each sites that needs access to them uses.
If you dont want to both with the storage there are many "cloud" storage servers that will host all your images for you. (like Amazon S3, Smugmug, flickr).
But then you will have to build the logic in your app to upload the submitted images to your 3rd party storage provider.
You can store images inside a database. There are plenty of tutorials on how to store images in a database (images in mysql php, images in mysql asp.net, etc). The language isn't important, any of the tutorials can help show how to store images inside the database itself. Then it's just a matter of language specific calling the image out to display it.
Have you considered storing your images on something like Amazon S3? You could then access the images from both sites. Somehow, though, you'll need to store the URLs to the images and make them available for both sites.
If both sites run off of the same database, this is fairly easy, however, if they are separate databases, then I would suggest creating some sort of API on the creation site so that the content site can easily discover which images are available to be shown.

Resources