SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to upload document dynamically.?

    i m doing one webapplication using oracle database. i dnt knw how to upload multiple document. i m geting fileupload control dymanically bt how to insert data in database tht i dnt knw.

    for this i have taken 4 fields they are:

    docid,docname,doctype,docextention,document.

    plz can any1 help me for how to upload document dynamically ?

  2. #2
    SitePoint Addict kunalraj's Avatar
    Join Date
    Nov 2008
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    In your requirement there is document name, id and doc type entered by user OR user only upload file?

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    user will only upload the file.

  4. #4
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,868
    Mentioned
    37 Post(s)
    Tagged
    0 Thread(s)
    Multiple file upload - Google is your friend

  5. #5
    SitePoint Addict kunalraj's Avatar
    Join Date
    Nov 2008
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,


    If user only upload file than you have to get docname,doctype and docext from its path.
    and id you have to auto generate.
    e.g.
    If user upload like this C:/xyz/beauti.jpg
    so this is the path. And from this you have to find last index of /
    after that from that lastindex of / to find out index of .
    so between / and . its document name after . it is extention of doc and for doc type you have to code if extention is jpg||jpeg than doctype is jpg and if your extention is DOC||doc than your doctype is word doc.


    thanks,
    kunalraj

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya i hav generated docid as autogenerate bt how to insert multiple doc at a time tht i dnt knw.?

  7. #7
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i m getting error while file upload. here is my code.
    dataaccesslayer:
    public bool doUpdateInsert(string Query)
    {
    bool isUpdated=false;
    OracleCommand cmdSSTrack = null;
    OracleConnection connSSTrack = null;
    connSSTrack = new OracleConnection(this.ConnectionString);

    try
    {
    connSSTrack.Open();

    cmdSSTrack = connSSTrack.CreateCommand();
    cmdSSTrack = new OracleCommand(Query, connSSTrack);

    cmdSSTrack.CommandText = Query;

    cmdSSTrack.ExecuteNonQuery();
    isUpdated = true;

    }

    catch(Exception ex)
    {
    throw ex;
    }
    finally
    {
    connSSTrack.Close();
    }
    return isUpdated;

    bussiness logic:
    public bool AddAtachment(string query)
    {
    try
    {
    return objAccess.doUpdateInsert(query);
    }
    catch
    {
    return false;
    }
    }
    aspx.cs file:
    OracleCommand cmd = null;

    squery = "insert into ims_document(document_id,document,incident_id) values (ims_attachment.nextval,@document,(select incident_id from ims_incident where created_By= '" + createdby + "'))";
    cmd = new OracleCommand(squery);

    cmd.Parameters.Add("@document", OracleType.Blob).Value= attach1;
    objCreateIncident.AddAtachment(squery);

    in this i m getting the value of attach1 but its not storing in the field(@document).
    can any 1 can help me what the mistake in this code ?


Bookmarks

Posting Permissions

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