Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Karen Worth 47 posts 140 karma points
    Sep 15, 2020 @ 07:37
    Karen Worth
    0

    System.IO.PathTooLongException Umbraco Forms - how can we handle this with a user friendly message?

    I've tried various things now but nothing seems to work. Evaluating the file name length in the ValidateField function in the FieldType.cs, doesn't work, because the issue occurs BEFORE the validateField function is hit.

    Trying to tackle it in the ProcessSubmittedValue in the fieldtype.cs, also doesn't work, I can rename the file etc, and then do a save as, which saves the actual file, but not the filepath on the database.

    After 3 days trying to resolve this (what should be a simple enough fix) I am at tether's end and can find nothing that addresses this in terms of advice or tutorials online.

    It's important because currently if the filename is too long the form user gets an ugly .net error message, I just want to return a friendly error message!

    Please help!

Please Sign in or register to post replies

Write your reply to:

Draft