• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Removing temp files

 
muneer ahammad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing problem in removing the temp files (PDF) which i m creating threw servlet using iText. once the pdf is created and its saving in the temp internet folder.how do i prevent/delete storing the created pdf?

Kindly help in solving this issue.

Regards,
Muneer.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that iText is creating files on the server or are you talking about the copy that gets saved to the client's temp folder when they open the PDF?
 
muneer ahammad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i means to say that it gets saved to the client's temp folder when they open the PDF
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's something you (the web developer) have no control over.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally you can instruct a browser to do not cache content file. It is really big security risk to have the file kept in the directory. Did you try to

?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by D Rog:
Generally you can instruct a browser to do not cache content file
Caching and downloading are two very different things. The cache control headrers have no effect on how long temp files are kept.

The file must be stored on the client system in order for it to be opened. There is no way to make it go away after any certain period of time.
[ February 29, 2008: Message edited by: Bear Bibeault ]
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is just yours understanding the problem. For example Adobe reader gets just URL and manage downloading itself. So no temporary file is created at all. So you are just kindly not right.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by D Rog:
For example Adobe reader gets just URL and manage downloading itself. So no temporary file is created at all.



That's not what I see when I watch the network traffic with a packet sniffer.
I put a PDF up on my server http://www.souther.us/nissan_manual.pdf.
Then I created an HTML page with a link to that PDF http://www.souther.us/getPdf.html and watched the network traffic with tcpflow while clicking on the link


tcpflow -c port 80
tcpflow[3294]: listening on eth0
192.168.001.002.34369-069.059.022.027.00080: GET /nissan_manual.pdf HTTP/1.1
Host: www.souther.us
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.souther.us/getPdf.html
Cookie: JSESSIONID=AFAB73FBE382925690CD5DDBBA05CAE6


069.059.022.027.00080-192.168.001.002.34369: HTTP/1.1 200 OK
Date: Sun, 02 Mar 2008 03:45:11 GMT
Server: Apache/1.3.37 (Unix) mod_jk/1.2.20 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Last-Modified: Sun, 02 Mar 2008 03:40:40 GMT
ETag: "58066b-eec1c-47ca21b8"
Accept-Ranges: bytes
Content-Length: 977948
Connection: close
Content-Type: application/pdf


Notice that the user agent (in bold) is Mozilla / FireFox, not Adobe Acrobat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic