• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with e-mail attachment  RSS feed

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am trying to send e-mail with attachment. The problem is that when I construct File of attachment it fails due FileNotFoundException. This is what I do:

When I send e-mail that's when I get FileNotFoundException. Printing out fileName works file I get http://127.0.0.1/demo/test/tmp/55.prn, but once e-mail is send I get the following:

As you can see it maps URL as http:/127.0.0.1/ instead of http://127.0.0.1/
Any suggestions?
thanks,
Alex
[ January 26, 2004: Message edited by: Jim Yingst ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A string beginning with http is a URL, not a file name. They're similar, related concepts, but with different syntax. Given the URL you specify, the file name is probably something like
C:\html\demo\test\tmp\55.prn (Windows)
or
/html/demo/test/tmp/55.prn (Unix)
Where in both cases "html" may be replaced with whatever the path to your server's base html directory is. This is something that can be configured for most webservers.
If your program is already executing from within the html directory, you can also use a shorter, relative path:
test\tmp\55.prn (Windows)
or
test/tmp/55.prn (Unix)

You'll need to find out where the file is on your own machine, and where you're executing from. But hopefully this may give you some idea...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!