I have a lotus notes web form in which computer-illiterate customers will use to attach Excel files and submit them to our company. I am using a Lotus Notes File Upload Control to allow them to do this, however, I need to default this File Upload Control to a certain directory location. I have already created a C# application the customers will be using, which places all of these excel files in a certain directory location, hence the reason I need to focus this File Upload Control. Unfortunately, some of the customers are computer challenged enough to not know how to navigate to these files on their own. Is this possible at all?
I'm assuming the users will be visiting a web page with the File Upload control, yes? If I'm misunderstanding please let me know and I'll delete this answer.
The simple answer is it isn't possible. The problem is that the browser can't know anything about the file structure of the clients that visit the site, so a "default path" property doesn't really make sense. It would likely only work in very specific environments (which is maybe true in your case, but not across the web in general)
I would investigate using the Notes API to have the C# program handle the upload without involving the browser client use of the file upload control. I don't know enough Java to be sure, but perhaps that might also be an option -- basically writing your own custom upload control that only asks the user for the filename.
You may also be seriously underestimating the ability of the users to follow directions. If your page identifies which directory the file will be found in, I expect most users will be able to follow the directions and upload from the correct directory.
So, I'm sure that accomplishing what you want to accomplish is possible in Notes, just not as simply as adding a default directory to the File Upload Control.
Related
I want to browse a specific folder which is on another server (other than on which our application is deployed) Through file upload control in asp.net (C#).
I'll need to make a restriction on file upload control, that it should take every user(student) to his own profile folder. Is there any possibility or a way to get that done.
I have googled a lot, but could not get solution.
Generaly no you can't do that. although some browser might use the value in the attribute Value.
But then again you have to know the path to their profile. So the answer is no.
Background
Due to licencing on our Medical PDF Documents, our Doctors are restricted to only have 2-3 of them viewing a PDF document at once.
While we know we could just make a copy of everything and distribute it among everyone, our Doctors feel that they don't want to breach the licence, thus need an effective way to restrict access.
Challenge
While I understand the basic concept of this, I had the idea to use one of two ways:
Have folder access rights on the on the physical PC, to hard-limit the amount of users entering.
Store the information in a database, making the web application restrict the users.
Conclusion
I really don't want to use hard file access rights. This isn't nearly diverse enough for my liking.
I would rather have the application restrict access, because it will then be easier for me to set rights based on users.
My Question
If I did have it database side, I will go about storing the physical PDF's in a folder, then linking them to a page. This page will have a button to open the PDF, that will be enabled/disabled based on the current amount of people who have clicked on it.
When a person clicks 'Close' on the PDF, the application will -1 to the count, allowing a person to access the PDF.
How would I make my application know the PDF has closed?
You should display the pdf in an iframe and provide a "Close" button outside that iframe. This way you will be able to track your open documents' count and act accordingly.
I don't really know how to explain what I want to do.
I will try to explain what I am doing. I built a website in ASP.NET 4 (WebForms) and I want that my brother will be able to click on a button, choose a file from his computer and it will be uploaded to my server.
I have no idea how to do it. It sounds very hard to do and I am really stuck with this for a few days now.
I don't care if it will be with JavaScript, HTML or C#, I just really need it to work.
There's an ASP.NET control made just for that, the FileUpload control. Here's a handy example.
Note that it's notoriously difficult to style if you want to apply CSS and make it elegant, but there are more advanced ways around that. Also, this won't give your web application access to the client's local files or anything like that, it's just a standard file open dialog box for the user to select a file and upload it.
I also highly recommend doing a lot of input checking when accepting files. File type, file size, etc. are all important.
you have 2 options really.. use a traditional fileupload control (from the toolbox) or use the Ajax AsyncFileupload control.
either way it will allow your brother to upload a file from his computer to your server.
We all know that it is possible to "open" a Word document (or file from any arbitrary application) by clicking on a website link and then clicking the Open button.
I also know that, if I want to upload an application document to a web server, I must first save the document to my computer, and then go to an upload page, click a file/open button, find my saved file and upload it.
But is it possible to save a document to a website location or Url, effectively skipping the first save step and uploading the file to the web server through the Save dialog of the application, directly?
How would this be done in ASP.NET MVC?
It really depends on how complex you want to make it. This is pretty much what "web folders" offered (via WebDAV), but in general it creates more problems than it will ever fix. I don't recommend this approach.
Your best bet to make this simple is a dedicated client app - perhaps (although this is a dubious example) how Office talks to sharepoint. In a simpler example, you could create a silverlight out-of-browser application that saved via a web-service to a site using WCF or similar.
I think there is some creedence in what #Marc says. Personally I'd probably map a drive to the web site in question, if that's possible, and have a folder to upload to.
Then I'd have .Net check changes to the folder and take those files and import them into the repository, whatever that may be.
It's still an imperfect solution and I'm not sure there is a correct solution as yet.
I guess you could always write, and I can't believe I'm writing this, macros to save to the ftp location.
I'd guess you have a few choices, in no particular order:
Web service that the application can reference and upload through.
REST service (WCF or otherwise) that the application can POST to.
HttpHandler or MVC controller action that the application can POST to.
WebDAV directly to the server.
Number 3 sounds like it's closest to what you were looking for ("How would this be done in ASP.NET MVC?"). Scott Hanselman has a good article on handling file uploads in MVC on his blog.
When you implement the client, there's a little bit of a trick to that, too, since you can't just POST like usual; you have to post in multipart/form-data format. I posted a blog entry with some sample code on how to do that.
I would like to open multiple download dialog boxes after the user clicks on a link.
Essentially what I am trying to do is allow the user to download multiple files. I don't want to zip up the files and deliver one zipped file because that would require a lot of server resources given that some of the files are some what large.
My guess is that there may be some way with javascript to kick off multiple requests when the user clicks on a certain link. Or maybe there might be a way on the server side to start off another request.
Unless the client is configured to automatically download files, you can't accomplish this without packaging the files in a single response (like ZIP solution you mentioned.) This would be a security issue if a Web site would be able to put arbitrarily large number of files on your disk without telling you.
By the way, you might be overestimating the cost of packaging in a single file. Streaming files is usually an I/O-bound operation. There should be enough CPU cycles to spare for piping the data through some storage(tar)/compression(zip) methods.
If you absolutely, positively cannot zip at the server level, this would probably be a good instance for creating some sort of custom "download manager" client-side plugin that you would have the user install and then you could have complete control over how many files you downloaded, where they went, etc.
I suppose you could link to a frameset document or a document containing iframes. Set the src of each from to one of the files you want to download.
That said, a zipped version would be better. If you are concerned about the load then either:
zip the files with compression set to none
use caching on the server so you zip each group of files only once
Present a page with a form of check boxes of the available files for download - with multiple select enabled for the check boxes.
User selects multiple files and submits forms.
Server accepts request and creates a page with serial-triggered file download javascript.
The page with the embedded javascript is presented to the user's browser, listing and asking for confirmation the files to be serially downloaded.
User clicks [yes - serially swamp my harddisk with these files] button.
foreach file, listener for download completed triggers the next download, until end of list.
I only know how to do this using Google GWT, where I had set up GWT RPC between browser and server. Took me two weeks to understand GWT RPC and perfect the download. Now it seems rather simple.
Basically (do you know basically is one of the most used non-technical words among the geek community?), you have to declare a server service class specifying the datatype/class of transfer. Where the datatype must implement serializable. Then on the browser-side the GWT client declares a corresponding receiver class specifying the same serializable datatype. The browser side implements a listener for onSuccess and onFailure.
Hey, I even managed to augment GWT service base class so that I could use JSP rather than plain servlets to implement the service interface.
Actually, I was not downloading a series of files but streams that conditionally serially triggered the next stream, because my onSuccess routine would inspect the current stream to decide what content to request for on the next stream.
Ok, two weeks was an exageration, it took me a week to do it. A genius would have taken half a day only.
I don't see what the big deal is with this. Why not something like this:
Click me
<script type="text/javascript">
$('a#myLink').click(function() {
window.open('http://www.mysite.com/file1.pdf', 'file1');
window.open('http://www.mysite.com/file2.pdf', 'file2');
window.open('http://www.mysite.com/file3.pdf', 'file3');
});
</script>