Send data after download

Alex Koshel asked on March 25, 2021 18:55

Hello everyone. Sorry for my English. Such a task: There is a page with documents. When downloading the document for the first time, the user is redirected to a page with a form to fill out. After filling out the form, the user receives a cookie = "IsRegister" and a unique Guid. When you download any document again, it downloads without a registration form because the user has received a cookie. need to implement sending custom data after every document upload. What do you advise ?

Recent Answers


Alex Koshel answered on March 25, 2021 19:25 (last edited on March 25, 2021 20:19)

I am thinking about a global event https://docs.xperience.io/k11/custom-development/handling-global-events/reference-global-system-events#ReferenceGlobalsystemevents-DocumentEvents

 if (IsUserRegistered())
 {
    var url = GetRedirectURL(true);                
    Response.Redirect(url);    
    //here i want send data      
 }
0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on March 26, 2021 15:07

Hi Alex,

Unfortunately there is no enough info to advice you something...

First of all are you using Portal or MVC approach? What version of Kentico?

Also I'd like to understand what web part/control are you using to list documents? And is some pieces of that task completed or you're asking for advice on general approach?

My recommendation would be to avoid checking for cookies on file download, but for the entire documents list page e.g.: * user navigates a page with documents * system check for cookies * if cookies present - show the page * otherwise redirect to the form page

Thanks, Roman

0 votesVote for this answer Mark as a Correct answer

Alex Koshel answered on March 26, 2021 20:36

First of all are you using Portal or MVC approach? What version of Kentico? Portal, Kentico 11. The functionality is already ready. I need to make some edits.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.