Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 31st, 2007, 09:03 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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;

Reply With Quote
  #2 (permalink)  
Old April 10th, 2007, 07:32 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
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
Reply With Quote
  #3 (permalink)  
Old April 18th, 2007, 04:18 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
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;

Reply With Quote
  #4 (permalink)  
Old April 23rd, 2007, 11:43 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.