Link File Attachments - InfoPath Dev
in

InfoPath Dev

Link File Attachments

Last post 07-17-2006 11:01 PM by nukkumatti. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-13-2006 08:47 AM

    Link File Attachments

    I am new to infopath, so please bear with me. I have been working with the file attachmnet control, and everything was fine until we realized that if you attach a bunch of files... things get really big. How can I got about creating an attachment control, where I can browse my computer and it will create a hyperlink to that file on the shared drives.

    Thanks,

    David
  • 07-14-2006 02:11 AM In reply to

    Hi have done a similar thing. I have some custom browse buttons in my views. With there help the user can browse his directory or network drives. After selection of the file the path gets written into a text box. Then when the user submits the the form I create a new folder with a unique ID for each request. (or whatever) Additionally all the selected files are uploaded to that folder and I create a hyperlink to that specific path which i then have in the other views.
    Hope the idea helps.
    If you need some help with the code let me know. Mine is in C# by the way.
    Cheers
    Listen to Motörhead cos they play Rock'n Roll :)
  • 07-14-2006 06:55 AM In reply to

    Yes, I would appreciate some code help. I don't really need to create a folder. I just need a browse button to create a hyperlink apon file selection.

    Also, how can i use C# without access to Visual Studio.
  • 07-16-2006 11:24 PM In reply to

    Hi again,

    first thing you need to do if you want to code with C# you have to download the InfoPath toolkit for VS. This you can get from here: http://www.microsoft.com/downloads/details.aspx?familyid=7E9EBC57-E115-4CAC-9986-A712E22879BB&displaylang=en

    I have the following method which I call from the button click events. The parameter is the textbox in which i want to write the path of the selected file:

    public void getFile(IXMLDOMNode attachmentBox)
    {
    OpenFileDialog ofdlg = new OpenFileDialog();
    ofdlg.Title = "File Browser" ;
    ofdlg.InitialDirectory = @"c:\" ;
    ofdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*" ;
    ofdlg.FilterIndex = 2 ;
    ofdlg.RestoreDirectory = true ;
    if(ofdlg.ShowDialog() == DialogResult.OK)
    {
    attachmentBox.text = ofdlg.FileName;
    }
    }


    With the file now in your textbox you can use this as a datasource for your hyperlink.

    Let me know if you need more support.

    Jerome
    Listen to Motörhead cos they play Rock'n Roll :)
  • 07-17-2006 01:27 PM In reply to

    Is there a way to do this with JS? I do not have access to visual studio on the computer that I am forced to work on?

    Thanks much!

    - David
  • 07-17-2006 11:01 PM In reply to

    Hi Phusion,

    I am quite sure that it is possible to do the same thing in JS but my JS skills are really limited. I'll try to find out how to do but hopefully some other guy also reads this thread, cos I know that there are many around who know how to do it.

    So far..
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.