There is file stored in Google Drive. It is needed to open this file in browser. Google API JS library has method gapi.client.drive.files.get. It allows to get file resource which contains downloadUrl. This url allows to download file and save it on disk. Query string of url contains parameter e=download. If value of this parameter is changed to 'view' (e=view) then this url can be used in order to open gif file in browser. Nevertheles if the same is made with url to txt file then file is downloaded anyway.
Is there Goggle url which can be used to open txt file in browser? How to get such url?
Use the
webContentLink
:"A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials."