I'm using a list which allows users to attach files to an item but removes the delete option using javascript. I need to find out if theres a way I can allow users to continue uploading documents to the list but if the name is the same to add a prefix or suffix. Right now I get an error if I try to upload the same document to the item.

This is what I have. Basically users from one group can create a list item with attachment (work order). Users from a second group can only edit those items. The button at the top disappears based on the users email domain. I still need to figure out how to grab a users group or permissions but that's be later. Anyways, the user with edit permissions basically takes the other from new to inProgress to Pending to Completed. Through those stages, the document changes and the client wants to keep a history (I dont know why, it's actually really dumb but they're clients so not much I can do). So they don't want the editor to delete the initial document but they do want them to be able to download it, make changes to it, upload it back to the item. However, if the attachments have the same name, I get an error (not sure why), normally I assume it would just replace the document with the new version. So what I'm trying to figure out is if I can get any new uploads to be renamed, preventing the error I got or the overwrite of the initial attachment. Relying on the user to change the document file name, I foresee this resulting in many errors, so i'd rather find a way to automate that. enter image description here

  • Can you share your code? Commented Aug 24, 2013 at 1:57
  • Which code do you mean? I don't have code for this functionality, I don't even know if it's possible
    – Batman
    Commented Aug 24, 2013 at 2:33
  • So you basically want to upload a same named file as an attachment to the list item and rename it by adding some prefix or suffix? Do you want using Client or Server object model? Commented Aug 24, 2013 at 2:55
  • I think client would be prefered. We don't have access to the server (I don't know if that matters). Most of the things I do are using CEWP and attach Javascript to them.
    – Batman
    Commented Aug 24, 2013 at 2:59
  • I updated OP with a bit more information and reason why I'm asking
    – Batman
    Commented Aug 24, 2013 at 3:07

1 Answer 1


Can you create a seperate doc lib and store your docs in that then provide a lookup to the doc lib in your list and allow multiple? I've always hated working with item attachments... not saying lookup columns are much better tho.

  • I see what you mean but it would require too much work from the users. I designed it with simplicity in mind. If I have them go to a library to upload the documents (there's a lot) then go to the list and find the document in a look up, it might be too much steps for them. At that point, I'd rather just have them rename the document and upload it again.
    – Batman
    Commented Aug 23, 2013 at 19:46
  • How many other fields in your list are there?
    – Josey
    Commented Aug 23, 2013 at 19:53
  • There are maybe 8-10 fields. But I use .js to hide and show them based on various conditions
    – Batman
    Commented Aug 23, 2013 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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