how to get author from file when upload using upload control using javascript

function CheckSchemaFileExistence() 

{

var Schemafilename=document.getElementById('<%= this.flUploadB.ClientID %>').value;

if(Schemafilename.length>0)

{

return true;

}

else

{

alert("File Name cannot be empty");

return false;

}

}

 

we written code in button click . i need a file author name . how to find it can any tell me .

thanks in advance

0
harish448
5/20/2008 8:10:34 AM
asp.net.client-side 24353 articles. 2 followers. Follow

1 Replies
1281 Views

Similar Articles

[PageSpeed] 54
Get it on Google Play
Get it on Apple App Store

Hi harish448

For your information, I know you want to get the file's author name, which from client-side

But I think Not all type of files have the attribute of "author name" (I think only office file like .doc .xls have)

if you want to get a .doc file's author name, I suggest you to use OWC

The following code show how to get a doc file's author name and subject, Hope this helps:

    Word.Application oWord;
            Word._Document oDoc;
            
object oMissing = Missing.Value;
            
object docBuiltInProps;

            
object Source = @"DocPath";
            
object Unknown =Type.Missing;
            oWord 
= new Word.Application();
            
            
try
            
{
                oDoc 
= oWord.Documents.Open(ref Source,ref Unknown, 
                    
ref Unknown,ref Unknown,ref Unknown, 
                    
ref Unknown,ref Unknown,ref Unknown, 
                    
ref Unknown,ref Unknown,ref Unknown, 
                    
ref Unknown );

                docBuiltInProps 
= oDoc.BuiltInDocumentProperties;
            
                Type typeDocBuiltInProps 
= docBuiltInProps.GetType();
            
            
                
//获取作者
                string index = "Author";
                
string propsValue;
                
                
object docAuthor = typeDocBuiltInProps.InvokeMember("Item"
                    BindingFlags.Default 
| 
                    BindingFlags.GetProperty, 
                    
null,docBuiltInProps, 
                    
new object[] {index} );
            
                Type typeDocAuthorProp 
= docAuthor.GetType();
                
                propsValue 
= typeDocAuthorProp.InvokeMember("Value"
                    BindingFlags.Default 
|
                    BindingFlags.GetProperty,
                    
null,docAuthor,
                    
new object[] {} ).ToString();
                
                MessageBox.Show( propsValue,
"Author" );

                
//获取主题
                index = "Subject";
                propsValue 
= "The Subject";
                
                
object docSubjectProp = typeDocBuiltInProps.InvokeMember("Item"
                    BindingFlags.Default 
| 
                    BindingFlags.GetProperty, 
                    
null,docBuiltInProps, 
                    
new object[] {index} );
            
                Type typeDocSubjectProp 
= docSubjectProp.GetType();
                
                propsValue 
= typeDocSubjectProp.InvokeMember("Value"
                    BindingFlags.Default 
|BindingFlags.GetProperty,
                    
null,docSubjectProp,
                    
new object[] {} ).ToString();
                
                MessageBox.Show( propsValue,
"Subject" );

            }

            
finally
            
{
                
//关闭word进程
                object save = false;
            
                oWord.Quit(
ref save,ref Unknown,ref Unknown);
            
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord);    
            }

Regards!

-- "Mark As Answer" If my reply helped you --
0
blodfox777
5/20/2008 8:31:54 AM
Reply:

Similar Artilces:

How to identify the original file type and restrict the file uploading while using file upload control
 Hi asp.net , I am uploading a file using FileUpload control in asp.net using vb.net.I wrote the code to upload only PDF files. the user can change the extension and change to PDF . I have to check is the file original PDF or not then i have to upload the PDF files only . How to do this ??  Hi, Check the file Mime type for "application/pdf" by looking at the:  FileUpload1.PostedFile.ContentType RegardsSmcoxonNo Gem is ever polished without some friction. Hi smcoxon , Thanks For Replying ,But i found that there is no use using PostedFil...

Add link buttons to each file uploaded using File upload control
Hi,   In my application I have one file upload control. When the user selectes a file to upload and when he clicks on Attach button I need to show him the file name of the file he selected to upload and also show the Remove link button after the file name. In this case I need to generate link button dynamically. I wrote a code like the following:protected void btnAttach_ServerClick(object sender, EventArgs e) {string strFileName = MyFile.PostedFile.FileName;string c = System.IO.Path.GetFileName(strFileName); listBoxAttachedFiles.Items.Add(c);LinkButton b = new LinkButton(); b.Te...

Is there any limitation of file types that file upload control can be used to upload?
I am working on a content management system which requires me to upload WebEx recording files (.wrf) through file upload control. But I am getting "internet explorer cannot display the webpage" error. It worked with other files types as txt, doc, xls, pdf, jpg, gif etc. Is it related to any security issue or just a bug with the file upload control?  Thank you. The file upload control doesn't have any file type limitations that I'm aware of, but it does have some size constraints.  By default, ASP.NET is configured to not accept any file's larger than 4...

without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? avdp211:without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? I don't think it is possible.You use the the HTML input file control and when you post the request, on the web server you need to read the data and save it to a file, so there has to be some interaction with the server to handle the post request.  Not possible vi...

Upload Image In Gridview using File Upload Control
Hi, I have question that i want to upload image in Gridview for differt users. And i also don't know how to fix size while upload the image.Can You please tell me how to upload images for the different users and how to fix size so i can save all users name with their own logo image. I just have started work with asp.net so i will be very thankful to you if you can give answer with code.       Hi, Nisha Shah Based on my experience, please refer to the following code: //HTML <asp:GridView ID="GridView1" runat="serv...

When I upload a text file from client to server using stream, how can I guarantee that the uploaded text file can be displayed correctly?
When I upload a text file from client to server using stream, how can I guarantee that the uploaded text file can be displayed correctly? A user want to upload a text file from client PC to server (normally it is Windows 2003), but I'm not sure which OS it is in client, maybe it is a english version Windows or chinese Windows (default encoding is GB2312).so the encoding of text file in client maybe is ASCII or GB2312.I think that "StreamReader myRead= new StreamReader(FileUpload1.PostedFile.InputStream,Encoding.Default) will be run in server,so "Encoding.Default" will be the default encodin...

How to use client-side script(javascript) in DNA using .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script> objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ...... }   szUrl = "http://ServerNa...

Upload file from remote Computer using File Upload
Hi,     How to upload file from remote computer. Can i browse it thruough the File Upload control ?    Please help?     RamarjunK:Hi,     How to upload file from remote computer. Can i browse it thruough the File Upload control ?    Please help?  you can. when the file open dialog box comes, choose my network places, select the corrosponging share, specify the credentials.  then choose the file.you haven't do any thing special, coding is same .Give a man a fish and you feed him for a day. Teach a man to fish a...

how to get a video file size using javascript while uploading it
 i would like to get a video file size in javascript while uploading it using file upload control.. please help me.... ThanxRaj.   You can't do it before or while uploading. You can only do that AFTER the file has been uploaded and saved on the server. NC...  ...

how to empty the file upload control using javascript when it is not valid ?
function checkFileExtension(elem) { var filePath = elem.value;if(filePath.indexOf('.') == -1) {alert("Browsw Path Can not be empty");return false; }  var validExtensions = new Array();var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();   validExtensions[1] = 'xls';validExtensions[2] = 'xlsx';    for(var i = 0; i < validExtensions.length; i++) { if(ext == validExtensions[i])return true; }alert('The file extension ' + ext.toUpperCase() + ' is not allowed!');return false; }...

Upload multiple files to the server without using File Upload
I want to upload multiple files to the server without using input type file (File Upload). Is there a way to do this. What I want to do is retrieve multiple file paths (paths are displayed in a user control like text boxes) and upload those files to the server as a bunch. I tried to set the value of the File Upload cotrol (using javascript) but it was not succeed since attributes of the File Upload are readonly. (document.getElementById("fileUploadValue").value = "C:\Test.txt") Is there a way to override the values in File Upload control or is there a way to up...

How to upload file without using file control...???
Hi, I have List of file path of Client. say "C:/WordDoc/Document1.doc". Now i want to upload this file to server.I dont want to use File Upload or Input File HTLM Control. Only i have is Path in some lable or text box. Now, How to upload this file from client to server? I dont have idea on it. Java has Third party API for uploading but i dont have idea on it. Can one help me on it. Whether some ActiveX or API avialble to do so. Thank You In Advance...!!!   ---Bhavin I can't see any worthwhile reason to not use the FileUpload control, but..... http://www.aspfree.com/c/a/....

Uploading Files without using File control
Hi Everyone, I'm in need of a feature where i need to upload a file without using File control. Anyone have pointers to go about it ? I've already gone through this tutorial: http://www.15seconds.com/issue/010522.htmbut when i try to run the code it gives me the error on window 2000 PC:"Safety settings on this computer prohibit accessing a data source on another domain."even though security setting set to "Low". And on XP machine i get the error:"Can't create automation server" (or something like that not entirely sure)My actual requirement is to upload a file using AJAX.Help will be gr...

Upload file withouit using the file control
hi is there a way to upload files withouit using the  file control Not that I know of. I would require some kind of component to be installed Client Side (ActiveX etc.). Read this article for more information.RegardsAndre Colbiornsen ---------------------------------Seventh DayRåbygatan 1A,SE-223 61 LundSwedenMob.: +46-(0)708-97 78 79Mail: info@seventhday.se--------------------------------...

Web resources about - how to get author from file when upload using upload control using javascript - asp.net.client-side

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript SDK - Facebook-Entwickler
Overview The JavaScript SDK provides a rich set of client-side functionality for accessing Facebook...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 12/27/2015 6:44:04 PM