Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

(please note: this question isn't about the validity of allowing .exe files to be uploaded - We know the risks, and have read all the alternatives. For us, using .exe is critical, as we have decades of files that need to be available to our customers)

I'm building a list that will feed a custom web part that will provide customers with access to our software. I've configured the SharePoint web application to no longer block .exe files, and this works well when using the lists default form.

However, when I create a custom form for the list using InfoPath (via the "Customize Form" icon in the ribbon), and publish my form back to SharePoint, there's a change in behavior for attachments:

  • with the default form, when I click "Attach File" the file is attached immediately, and the form shows the attachment as "c:\fakepath\myfilename.exe". Once I've completed the other fields in the form and save the item, the file is uploaded. Once the file is uploaded the form closes and my list refreshes to show the new item

  • with the custom form, I click "Click here to attach a file" (this text/button change was automatic when I began customizing the form), but rather than attach the file immediately and upload when the item is saved, the file is uploaded immediately and then I'm told that .exe files are blocked.

The big difference I see is that with the default form the ability to attach a file is part of the "New Item" toolbar, but once I edit the default form, even if I change nothing, the attachment control moves INTO the form and then starts blocking file types.

Does anyone know a way around this? We really want to customize the form, as we have lots of columns in the list, but this is stopping us being able to do that.

Many thanks,

Kevin

share|improve this question
add comment

1 Answer

Maybe you can consider alternative approach for your solution.

You can add additional library designated for storing exe files. Then you can establish link between list and library by using additional url field on list to store direct link to exe in library (if you only have one-to-one relations) or you can use lookup field in library to establish connection to list item (works for one-to-many relations).

Your can easily design your custom InfoPath form to show links to all connected exe files stored in library.

Cons:

In your solution you can add new item and attach file in 1 step. My solution has 3 steps - add item, upload exe, make connection

Pros:

You are avoiding problem with blocked file type. You have better control of exe files since you can set additional permissions - eg. user can view product details (list) but without additional permissions (library) cannot download desired exe.

This is just alternative approach. I have a hunch that your original problem is with InfoPath services and that you will have hard time to find solution for this (if any exist). To add one more thing: I had some bad experience with attachments in past so I try to avoid them (at least for solving core issues)

share|improve this answer
    
Thanks for the suggestion. I'll consider this approach, though I'm wondering if the multi-step process might prove to be it's undoing when/if this is presented to my authors (the idea is that I set up the system, and they use it.. the more 'complex' the more often I have to hold their hands). Also, I'll have to see how this works with my custom Web Part: right now I just poll the list item and extract the attachment path, so I suppose I would just take the library item reference - but it's still something that needs to be checked out. Can you describe your 'bad experiences' with attachments? –  QMKevin Aug 3 '11 at 13:29
    
My 'bad experience' is mostly connected with design limitations of attachments (eg. versions). I also had some big difficulties with managing attachments and using custom aspx item forms in 2007 version. Then I decided: If you have data put it in the list and if you have file put it in the library. And yes, you need to put some extra work to get it done but it pays in the end when you have much more flexible solution. But this is just me and I bet you can find other developers with completely opposite opinion :) –  Vedran Rasol Aug 3 '11 at 23:24
    
Good to know. Again, thanks for the suggestion, I'll definitely look into it more closely as my project develops. –  QMKevin Aug 4 '11 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.