---
title: "how to read word document before uploading it by webpage"  
description: "how to read word document before uploading it by webpage"  
author: "Anonymous User"  
published: 2014-08-22  
updated: 2014-08-22  
canonical: https://www.mindstick.com/forum/2092/how-to-read-word-document-before-uploading-it-by-webpage  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# how to read word document before uploading it by webpage

how to read [word document](https://www.mindstick.com/forum/1869/read-from-word-document-line-by-line) before uploading it by webpage

## Replies

### Reply by Sumit Kesarwani

Hi Samuel ,\

You probably need an ActiveX Object to access the file content on the client system before uploading.

```
function CheckWordDoc(filepath){    var fso, f, ts, s;    var ForReading = 1, ForWriting = 2, ForAppending = 8;    var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;    fso = new ActiveXObject("Scripting.FileSystemObject");    f = fso.getFile(filepath);    ts = f.OpenAsTextStream(ForReading, TristateUseDefault);    while (!ts.AtEndOfStream) {        s = ts.ReadLine();        if (s.indexOf("Word.Document.8") != -1) {            ts.Close( );            return true;        }    }             ts.Close( );    return false;}
```


---

Original Source: https://www.mindstick.com/forum/2092/how-to-read-word-document-before-uploading-it-by-webpage

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
