Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Web Application - Allowing Attachments

    I have a web application for reporting waste, fraud and abuse set up and currently it runs with reads/writes/inserts etc. to SQL Server via ASP Classic. E-mail notifications are generated via CDONTS. They've asked if there's a way to do the attach files routine somewhere in the system. I thought I'd ask here what are the plus/minuses of doing something like this?

    I have total control over the SQL Server db here (heh heh heh <img src=/S/devil.gif border=0 alt=devil width=15 height=15> ) but NONE over the enterprise webserver. so, if ya'll have experience doing this sort of thing and have some ideas on good/bad idea (I think it's a bad idea <img src=/S/beep.gif border=0 alt=beep width=15 height=15>) let me know.

    TIA
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    Sounds like you're talking about two things here: 1) Inserting a file into a SQL Database and 2) Programatically adding an attachment to an email.

    1) Use the "image" data type to store a file in the database. Use the "enctype='multipart/form-data'" argument for the form tag to allow the user to upload data via a web form. Then insert the value of the uploaded data into the field you've specified to store the file.

    2) Email attachments are very easy with the .NET platform. Check the MSDN documentation and you'll find the details.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    actually, I'm guessing they don't want to do the e-mail attachment. I'm guessing they want to do the following: in the middle of creating a referral, add the ability to attach a file to the CASE. Then the person who accesses the case (not necessarily via e-mail, there's a suite of basic case management tools available) will be able to download/edit/upload etc. files to the CASE.

    So, yeah, I guess, insert a file into SQL Server. This makes me a little queasy. I'd prefer to set up a directory on a server for storing docs rather than good old SQL Server. That way any issues with storage, virii, etc. are removed from the SQL server box.

    FWIW, this referral system is State-wide and the case management tools are available via the 'extranet' which is the Enterprise webspace. What I'd like to do is:

    1. Find out how to do it, basically.
    2. Definately try and do any doc storage on a separate server/box

    in my Googling, I haven't found anything all that relevent to what I have in mind. .NET... whatever! I have it now and have messed around with it somewhat intensively and am not planning on a move at this time. Of course, I am going to a week long training on ASP.NET so I'm not being a curmudgeon... much. <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    <img src=/S/aussie.gif border=0 alt=aussie width=21 height=22>

    thanks for all you help, in this and my other little posts!
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

    After demo-ing, say something like 'Sure, it's cool and all, but let's buy/draft a box to store the docs before going into production.'

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    Storing the files on a file server (via web applications) leave the door open for a host of other problems, particularly security related. Storing them in SQL Server can easily eliminate security risks since the authentication for storing the file will be the same account used to access SQL for everything else.

    You can easily implement a virus scanner to check the file before uploading to SQL.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    well, if you think that's the way to go, then that's the way to go...

    how does the file storage work BTW? set up a column with BLOB type? or some kind of XML dealie? do word docs get converted to a bitstream? any limits on the kinds of files? what about VBA macros? and will I ever get to a point where there's nothing new to learn??? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    I'm sure there is more than one way to approach this.

    I generally use the 'image' data type in SQL. That stores a binary of any file you add to it. There is generally no limit at the database level (except for the disk-size limit of the database itself). However, you'll want to impose all logic of that type at the application level. There is also no limit on what type of data can be stored, including Word macros and the like. If you want to prevent files with macros, you'll need to handle that in your application logic.

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    sounds good. I can visualize the db stuff already. BTW, when I set up this system I wasn't aware of some basic issues re. security, so I think I'll put a different user and connnect string for the read/writes on this module.

    so what about the option to attach a file to a case? any advise on that? I'm thinking along the lines of invoking an API to browse for file, and that means, probably, javascript/java to keep things platform-neutral. I SUPPOSE I can go the Windows/IE only route as this is an Extranet, not the World, but my bias is to keep things agnostic.

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    The database design is your call. If there is an option for uploading more than one file, I would create a one-to-many table for the files along with a foreign key to tie it to your parent table. If you only allow one file per record, then put it in the same table as your main record.

    You can upload a file without using any javascript. It is totally platform agnostic. Also, you may consider a commercial tool such as ASPUpload to make the server-side handling of this a little easier.

    Try Googling for "browse file html" - the first article is this.

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Web Application - Allowing Attachments

    > option to attach a file to a case?

    Try <input type="file" id="upload" name="upload" />

    See INPUT type=file Element | input type=file Object (Internet Explorer - DHTML)

  10. #10
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web Application - Allowing Attachments

    gracias for the info. it will be a separate table with FK and some other jazz. i am printing that file upload article even as i type.

    i know it's early in the week, but...

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •