---
title: "I want to get full path of &lt;asp:fileupload  &gt; and then client can click the Preview button to see what file he/here has uploaded."  
description: "I want to get full path of &lt;asp:fileupload  &gt; and then client can click the Preview button to see what file he/here has uploaded."  
author: "Nattapong Unaregul"  
published: 2012-07-22  
updated: 2026-05-15  
canonical: https://www.mindstick.com/forum/429/i-want-to-get-full-path-of-lt-asp-fileupload-gt-and-then-client-can-click-the-preview-button-to-see-what-file-he-here-has-uploaded  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# I want to get full path of &lt;asp:fileupload  &gt; and then client can click the Preview button to see what file he/here has uploaded.

Here is my current [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii),When [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) browse his/her [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) the [Preview](https://answers.mindstick.com/qa/50628/how-to-preview-your-screenshot-on-iphone-8-8-plus) [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) will be enabled

```
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">        <asp:FileUpload ID="FileUpload1" runat="server" onchange="FileUpload_OnChange(this,event);"   />  &nbsp; &nbsp; &nbsp;<input  type="button" id ="Preview" value = "Preview" disabled="true"/> function FileUpload_OnChange(sender, e) {        document.getElementById("Preview").disabled = false;        }</asp:Content>
```

## Replies

### Reply by Anonymous User

Hi Nattapong Unaregul,\
Actually I didn't get you properly that what are you trying to ask ?If you want the total client side drive path like"c:\User\Desktop" to be upladed via fileupload control, then try this code:\
System.IO.Path.GetFullPath(FileUpload1.PostedFile.FileName) and For previewing file you can read file content via using ``Stream theStream = FileUpload1.PostedFile.InputStream; and after that you could preview the file to the client.


---

Original Source: https://www.mindstick.com/forum/429/i-want-to-get-full-path-of-lt-asp-fileupload-gt-and-then-client-can-click-the-preview-button-to-see-what-file-he-here-has-uploaded

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
