Possible to Browse filesystem with Web enabled form? - InfoPath Dev
in

InfoPath Dev

Possible to Browse filesystem with Web enabled form?

Last post 09-21-2009 07:16 AM by Doug.Walker. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-16-2009 02:04 PM

    Possible to Browse filesystem with Web enabled form?

    Hi there,

    I need a web form solution that will allow a user to open a dialog box, browse to a file and select it.

    Then it will populate a text field with the full path and file name (for visual reference mainly).

    Eventually, the form will email the file as an attachment using the text from the text field (when submit button is clicked).

    I've got the form working ... it emails where it's supposed to go and the information is all there.  I just need to specify a file attachment.

    It can be done with openfiledialog, but I can't use that in a web enabled form.  I've tried the "file attachment" control, but I can only get the file name (no path) when I convert from base64.
    If there was a input type="file" control I could just use the text from that ... but I can't figure out how to add one.


    I'm using visual basic.  Anybody have a solution?


     

    pseudocode
    .
    browsebutton_clicked
    .
    Filebrowserdialog.show
    'user selects file
    strfile=filebrowserdialog.fileandpathname
    txtAttach.text = strfile
    .
    .
    .
    submitbutton_clicked
    .
    strAttach = txtAttach.text
    'message is sent with attachment
    msg.attachments.add(strAttach)


  • 09-20-2009 06:48 AM In reply to

    Re: Possible to Browse filesystem with Web enabled form?

    I wonder -- would it be possible to convert the base 64 from the file attachment control and specify that as the attachment for the email? Actually, I just went to MSDN to look at the Add method for Attachments, and it seems to want a path. BUT, since your form is going to have to be full trust anyway, if you are going to access the user's file system, you could decode the base 64 and save the file to a temp location and pick it up from there -- clean up the file you saved after sending the email. The base 64 in the file attachment control, to my knowledge, doesn't contain the file path.

    Hilary Stoupa

  • 09-21-2009 07:16 AM In reply to

    Re: Possible to Browse filesystem with Web enabled form?

    I've done the base64 conversion thing and only get the filename.  Path info is not stored in the base64 file attachment control.  But saving to a temp location may do the trick.  Thanks for the reply. 

     Another part of this form is writing an event to a Sharepoint calendar.  I've been trying to save the file as an attachment to the event; but your idea seems a little slicker.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.