2

I'm still new in SharePoint and I have one question: Is it possible to send an e-mail when a error occurs during a file upload?

For example: When I try to upload a file which contains a letter or symbol which is not allowed ('#' for example ), I'm getting an error that it is not possible to upload a file which contains that symbol. So I wanted to send an e-mail when that error occurs. I tried with Event Receivers but the error handler in SharePoint is faster, so I cannot do it with Event Receivers or Workflows.

1

(Assuming you are on premises)

You mentioned "...but the error handler in SharePoint is faster". Actually it is not a matter of speed, it is a matter of precedence.

If your event receiver was an ItemAdding not only would you be able to catch the error (and send your email), but you might also be able to handle it as well (for example rename the file and complete the upload).

If your event receiver was an ItemAdded, it would never fire if the file upload failed.

d.

  • Thank You very much for Your answer. Actually I used ItemAdding but when I get the error with JavaScript I can not enter the EventReceiver. What I meant is that the error handler in SharePoint is faster, the JavaScript is faster because of that I can not enter the EventReceiver. – EdvinB Dec 20 '17 at 8:05
0

If you upload a file programmatically in SharePoint 2013, we can send the email when the file fails to upload.

But we cannot catch the exception if we upload the file by UI.

More references:

upload a file to SharePoint 2013 programmatically externally.

https://mscrmsama.wordpress.com/2016/03/18/upload-a-file-to-sharepoint-2013-programmatically-externally/

Code Sample : How to programmatically send an email in SharePoint.

https://www.collaboris.com/code-sample-how-to-programmatically-send-an-email-in-sharepoint/

Programmatically Sending Email in SharePoint.

https://sharepoint2013suresh.blogspot.sg/2014/03/programmatically-sending-email-in.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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