I'm trying to make the user click once on a button with on-click function and initiate file upload, without making him pick the file through clicking first on "Choose File" which opens file dialog box. Is this possible through populating the files[0] object array or [object File] if I have the full absolute path of such a file ?
            Asked
            
        
        
            Active
            
        
            Viewed 244 times
        
    -1
            
            
        - 
                    Imagine a random page accessing files on your computer... – Yury Tarabanko Feb 08 '16 at 16:35
- 
                    Ok, I got what you mean But do you know the structure of files[0] object array or [object File] can you give me a simple example please – user2985035 Feb 08 '16 at 16:41
- 
                    https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications – tanenbring Feb 08 '16 at 16:42
1 Answers
1
            
            
        No, without user input allowing javascript direct access to the user's file system would pose a large security risk.
Check out this answer.
 
    
    
        tanenbring
        
- 780
- 4
- 14
- 
                    Ok, thank you for your answer But do you know the structure of files[0] object array or [object File] can you give me a simple example please. – user2985035 Feb 08 '16 at 16:42
