Upload only partial file r shiny

I need to allow users to upload only the first n rows of a .csv file to my shiny app.

The files I want to upload are large, and take a long time to upload, so ideally, shiny would upload only the first n rows.

I know I can read only the first nrows using read.csv or data.table::fread, but I want to upload only the first nrows using shiny::fileInput (or some similar function).

Is this possible?

Hosted example here: https://shiny.rstudio.com/gallery/file-upload.html

Code for MWE here: https://github.com/rstudio/shiny-examples/tree/master/009-upload

R works with in memory data, so your file needs to be loaded in order for R been able to manipulate it, I don't think that there is a way for a shiny app to manipulate a file that is still in the client's hard drive.

Something like that would be possible, but it'd have to be a feature of fileInput and implemented in JavaScript. We don't have plans for doing that, sorry...