I provide users with a SAS token to upload blobs. I'd like to check whether the blobs represent a valid image or not. How can I do this? In the SAS token, I make sure the blob name ends with a jpeg extension, but this does not mean the users upload an image since everything is uploaded as a byte stream.
            Asked
            
        
        
            Active
            
        
            Viewed 389 times
        
    2 Answers
1
            
            
        This is Not possible as described here. Perhaps, the better way to validate is at the front end when the user tries to upload the file.
 
    
    
        Sajeetharan
        
- 216,225
- 63
- 350
- 396
0
            
            
        You can write an Azure Function that will be triggered every time a new blob is uploaded. And in that function you can validate if the blob is a valid image file, if it is not then you can delete it or send an email to uploader.
 
    
    
        Sadiq Khoja
        
- 522
- 1
- 5
- 23
