mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Use text mime type for csv files for browser preview
Co-Authored-By: Trenton H <797416+stumpylog@users.noreply.github.com> Co-Authored-By: bin101 <12427722+bin101@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									4e07280102
								
							
						
					
					
						commit
						c42388f7e2
					
				@ -261,6 +261,9 @@ class DocumentViewSet(
 | 
			
		||||
            file_handle = doc.source_file
 | 
			
		||||
            filename = doc.get_public_filename()
 | 
			
		||||
            mime_type = doc.mime_type
 | 
			
		||||
            # Support browser previewing csv files by using text mime type
 | 
			
		||||
            if mime_type in {"application/csv", "text/csv"} and disposition == "inline":
 | 
			
		||||
                mime_type = "text/plain"
 | 
			
		||||
 | 
			
		||||
        if doc.storage_type == Document.STORAGE_TYPE_GPG:
 | 
			
		||||
            file_handle = GnuPG.decrypted(file_handle)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user