1 / 8

File Upload

File Upload. &. Download. using. My SQL database. By:. Anand Shankar. ACIIL. File Upload. Client Browser. Multipart Format. Database Server (My SQL Database). Attach a file. Class Diagram for Upload Beans. Why I have created a separate component.

Télécharger la présentation

File Upload

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. File Upload & Download using My SQL database By: Anand Shankar ACIIL

  2. File Upload Client Browser Multipart Format Database Server (My SQL Database) Attach a file

  3. Class Diagram for Upload Beans

  4. Why I have created a separate component Design patterns and software development rules say… • Make a separate component for that codes which are used many times in your application. • These components should be easy to use. • Write proper documentation and class diagram for every component. • Your separate designed component should be flexible and can be used in another application also. • Avoid to write Java code in JSP pages. • The best JSP is, in which a single line of java code is not written.

  5. Flow Diagram • It follows MVC architecture of Design Pattern. • All the requests and responses go through a Central Controller. • Central Controller is responsible for all the activities of uploading and downloading and later it will work for whole QMS application as a Controller.

  6. Client (Administrative) Client Send file Request to Download files Download files Central Controller Beans Interacts with Beans Retrieve file from database Beans Store file in database in Binary format

  7. How can be used Upload Beans Very Simple steps to use this… • Put anandUpload1.0.jar file in WEB-INF/lib dir. • Set <form enctype="multipart/form-data" > of your .jsp or .html file. • Add tag <input type="file" name="file" /> in this .jsp or .html file. • Write code in your Servlet… • CentralControl cc = new CentralControl(); • Hashtable hs=cc.processRequest(request, response); • Your all the fields values of form will be returned in a Hashtable and you can simply get these values as… • String name=(String)hs.get("name");

  8. Thanks

More Related