i searched a lot for this one before posting this.
my requirement in brief: i)User selects an image. ii)I need to read the image iii)Store it in server's file system. (Not in database as BLOB) iv)The image selected by the user should be made visible in a page. so i need to give a reference to the image uploaded thru src attribute in img tag of the webpage.
now the problem is how to accomplish the iii) and iv) steps. i'm able to read the file from client machine thru MultiPart concept and i'm able to accomplish the first 2 steps.
the problem becomes tricky bcoz all the clients shud be able to see the image and we need to set the src attribute such a way that it is global and not specific to any client/server's file system.
i tried to give relative path, but its not working.
am i missing something which is very simple. help is appreciated [ June 14, 2005: Message edited by: Bear Bibeault ]
i'll make my pblm clearer. i'm able to read the file from the client machine ... means i'm getting the bytes. now my question is how to write those bytes to a file and where to store it so that it can be referenced by all the clients.
i guess we need information like where are you now currently storing your file (ie in which folder exactly).
For example, you can create an UserFiles folder in the Web part, along with the WEB-INF folder. Then write your files to this folder, note that it is better to use a relative path (relative to the context root of the application) to mention where to write the files.
Basically its relative and relative to context root of the application.
Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside HereWEBlog