Wrox Programmer Forums
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2007, 09:03 AM
Authorized User
 
Join Date: Jan 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Upload pdf files

Hi;

I have a JSP which display several links on pdf files (contracts), these files are updated every week by the customers (new, delete, change files) and send them via CFT on integration server => Questions :

1- How implement this JSP to manage correctly the change frequent of the pdf files
2- In production, I have only access to database server (any access to web server), how upload the pdf files ?

Regards;

 
Old April 10th, 2007, 07:32 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,
first you are not clear with your question. Can you be little more clear?

What i understood from the question is you want to display the links to the pdf file which were uploaded by some other users through some other application. If you know the directory into which the pdf file are uploaded in the server and you have read access to that directory you can user java.io.File class to get the reference to that directory and use list() method to get the list of pdf files and traverse through the array and generate links in your jsp.

Hope its usefull.

Regards,
Rakesh
 
Old April 18th, 2007, 04:18 PM
Authorized User
 
Join Date: Jan 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by rakesh_mscit
 Hi,
first you are not clear with your question. Can you be little more clear?

What i understood from the question is you want to display the links to the pdf file which were uploaded by some other users through some other application. If you know the directory into which the pdf file are uploaded in the server and you have read access to that directory you can user java.io.File class to get the reference to that directory and use list() method to get the list of pdf files and traverse through the array and generate links in your jsp.

Hope its usefull.

Regards,
Rakesh
Hi;

OK and if this directory is outwards of the deployment directory of JOnas (work directory) and the pdf files are not inside of war file but uploaded directly on the directory.
How implemented this JSP in using external directory ?

regards;

 
Old April 23rd, 2007, 11:43 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then you've to create a property file which will have the path to that directory and use this property file to upload the pdf files to that directory.
And to download you've to write a servlet which'll return the bytestream of the pdf file by reading the content of the pdf file [create a file class, use the path specified in the property file, and file input stream object]. You've to set the content type of the respose using setContentType() method to pdf mime type.

Hope its clear to you.

Regards,
Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
upload doc or pdf only sauravnimesh .NET Framework 2.0 2 September 16th, 2007 11:33 PM
restricting users to upload rtf or pdf files only sauravnimesh C# 2005 2 September 15th, 2007 04:08 AM
cant upload files akber ASP.NET 1.0 and 1.1 Basics 3 November 6th, 2006 03:06 AM
upload doc,pdf file from ORACLE 9i on JSP page ashwinmittal Pro JSP 1 November 30th, 2004 01:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.