cracking my head to solve this!!! help appreciated
I upload multiple files at a time. this is the screen written in JSP. say it upload.jsp
File name 1 ___________ browse save filename 2 ___________ browse save file name 3 ___________ browse save
there are 6 categories of files in the database..for ex say marketing, distribution, sales, etc..
the add/edit screen lists all the 6 categories and provides a source to upload files. the screen looks like this
marketing upload sales upload dist upload
when the user clicks on upload file corresponding to marketing the jsp window which i gave "upload.jsp" pops up and the user uploads the files and the files are saved in the database.
the corresponding table in d/b: "attachments" ( user_id, file_name, file_category, file_content BLOB, ......) There is only one common table..we dont want to create a seperate table for each category (strictly)....
So, Along with the file(BLOB) the file_category should be uploaded to the database.
same is the process for all the categories.
the problem: I refered the same "upload.jsp" to all the categories and i am confused in writing the logic for categorizing the files uploaded.
The other problem is, I should list all the files in the specific category(say 'Marketing') when the user clicks the MARKETING tab...other category files should not be displayed. Also ..i should give the count of the files in a specfic category.
Now, i need to provide the user(MArketing) with a view containing files belonging to 'marketing' FILE-CATEGORY( xml.pdf, bad.xls)
I m not able to think a sol'n for this!!
Help me out.
Joined: Feb 15, 2005
Maybe I'm not understanding the problem here, but this seems fairly simple to me. Just write a query .. select * from uploadedFiles where category = 'Marketing'. Is there a reason a simple query like this won't work?