mrackley / StratusForms

Lightweight InfoPath alternative for SharePoint 2007,2010,2013,2016,2019 and Office 365
82 stars 36 forks source link

Attachments with same name on different list items #47

Closed gebeauvoir closed 5 years ago

gebeauvoir commented 5 years ago

@mrackley What a great tool you created!

I get an error when I upload an attachment that has the same name as an attachment previously uploaded on a different list item. Error:

Error Uploading Document. Ensure the file doesn't already exist: Bad Request

Is there a way to fix this or to have the attachments go in a specific folder based on the list item? It is very likely that my users will upload items with the same name.

I am using v1.55

Thanks.

davidcfk commented 5 years ago

Change the code so that it prefixes the file with the ID of the item (avoiding the conflict). The files are added after the initial list item is added so it should be available by the time it commits the upload...

Or at least that is how I handled our one with this issue...

David

On Wed., 27 Feb. 2019, 7:47 am gebeauvoir, notifications@github.com wrote:

@mrackley https://github.com/mrackley What a great tool you created!

I get an error when I upload an attachment that has the same name as an attachment previously uploaded on a different list item. Error:

Error Uploading Document. Ensure the file doesn't already exist: Bad Request

Is there a way to fix this or to have the attachments go in a specific folder based on the list item? It is very likely that my users will upload items with the same name.

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrackley/StratusForms/issues/47, or mute the thread https://github.com/notifications/unsubscribe-auth/AE22I--weSHL8polpHU4an7mQEpo7S0yks5vRauLgaJpZM4bTMh_ .

gebeauvoir commented 5 years ago

Hi @davidcfk ,

I made the change to the "$.fn.StratusFileHandler" function and it works perfectly. Thank you!

kviknaMedical commented 4 years ago

I have a modern site on 2019 and installed the app, then created a form which is working fine. Now I added the Upload button but fails to upload any file. Any advice will be really appreciated.

The added text to the html is

<div class="SFDontSave" id="uploadfile" data-StratusFormsType="File" data-StratusFormsFileOptions="{libraryName:'OrderLibrary', lookupField:'Upload', displayOnly:false}">

OrderLibrary is the name of the Document library Upload is the lookup field to the List

lambayd commented 4 years ago

@davidcfk @gebeauvoir @mrackley @bcameron1231

On SharePoint 2019, I have tried to use the minimal Form on a Content Editor. Everything else work but does not upload any attachment. Can you share any sample code or advice how I can fix it? Is there any specific setting for the Lookup Field (see attachment)?

OrderLibrary

Title Field: