Hi Guys,
Following your wonderful advice, I've incorporated O'Reilly's multipart request classes to add file upload fuctionality to my bugtracker project. It works beautifully, however, I found a slight bug and was wondering if any of you have come across it, and if so, what are some possible solutions.
The bug: If you upload a file with the same name, it overwrites it. (IE: If someone attaches "error.log", it will replace the old one.)
One thing I considered is to append a unique parameter from the request to the filename (IE append the bug # to the filename, so you'd have "1234error.log" etc.) This would require modifying his classes and creating a new jar file (which I've never done, I'm a newbie... how hard is that? Is that doable within his liscence agreement?
I guess I'm asking what is the best way to rename a file before it gets copied. Is what I've described the best way to do it, if not, what would you recommend?
Thanks a bunch,
-Scott
(Sorry if this is a simple, boneheaded, question. I'm not a Java Developer and I'm teaching myself how to do this stuff and don't have anyone here to bounce ideas off of
Following your wonderful advice, I've incorporated O'Reilly's multipart request classes to add file upload fuctionality to my bugtracker project. It works beautifully, however, I found a slight bug and was wondering if any of you have come across it, and if so, what are some possible solutions.
The bug: If you upload a file with the same name, it overwrites it. (IE: If someone attaches "error.log", it will replace the old one.)
One thing I considered is to append a unique parameter from the request to the filename (IE append the bug # to the filename, so you'd have "1234error.log" etc.) This would require modifying his classes and creating a new jar file (which I've never done, I'm a newbie... how hard is that? Is that doable within his liscence agreement?
I guess I'm asking what is the best way to rename a file before it gets copied. Is what I've described the best way to do it, if not, what would you recommend?
Thanks a bunch,
-Scott
(Sorry if this is a simple, boneheaded, question. I'm not a Java Developer and I'm teaching myself how to do this stuff and don't have anyone here to bounce ideas off of