Editor - Intercept File Upload for external processing

Editor - Intercept File Upload for external processing

dpanscikdpanscik Posts: 202Questions: 47Answers: 0
edited January 10 in Free community support

I see some parallel rumblings about this topic for which somewhat but not entirely answers this question.

When editor uploads a file, on the server side (C# MVC) I would like to intercept the file upload, hopefully in the form of a System.IO.MemoryStream (or) Base64String, run it through some external processing, then return the processed file to the editor as a System.IO.MemoryStream (or) Base64String where editor can do its normal database entry and file save.

Any thoughts about how to do this?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    You can perform a custom file upload action, which will give you a HttpPostedFile instance or the file (so you can read it however you need).

    I don't believe you can write back to that object though, and it is what the Editor .NET libraries will use to access the file, if you are wanting to have them write to the db. What I would suggest instead is that you write whatever it is you need to the database, rather than using the Upload.Db() function (i.e. do it in your custom upload handler).

    Regards,
    Allan

Sign In or Register to comment.