ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Preview file on AnchorLink Click in AngularJS<p>Hi <a class="username" rel="mahesh213"> mahesh213</a>,</p> <p>Problem is with the App_Data folder.</p> <p>The App_Data folder is used as a data storage for the web application.</p> <p>It can store files such as .mdf, .mdb, and XML. It manages all of your application's data centrally.</p> <p>It is accessible from anywhere in your web application.</p> <p>So any file you place&nbsp;App_Data folder there won't be downloadable.</p> <p>So instead of saving the files inside the App_Data, create another folder inside the project folder and move the files to there and update your database record with the folder name.</p> <p>Check this example. Now please take its reference and correct your code.</p> <p>Here in this example i have used folder name Files to store the files.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.8/angular.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdn.jsdelivr.net/npm/angular-utils-pagination@0.11.1/dirPagination.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular-touch/1.6.1/angular-touch.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; var app = angular.module(&#34;MyApp&#34;, []); app.controller(&#34;MyController&#34;, [&#39;$scope&#39;, &#39;$http&#39;, function ($scope, $http) { $scope.terms = [{ Id: 1, Resume: &#34;F:/Web/File_Preview_AngularJS/Files/Test.jpg&#34;, Name: &#34;aaaa&#34; }, { Id: 2, Resume: &#34;F:/Web/File_Preview_AngularJS/Files/Test.pdf&#34;, Name: &#34;bbbb&#34; }, { Id: 3, Resume: &#34;F:/Web/File_Preview_AngularJS/Files/Test.xlsx&#34;, Name: &#34;cccc&#34; }, { Id: 4, Resume: &#34;F:/Web/File_Preview_AngularJS/Files/Test.doc&#34;, Name: &#34;dddd&#34;}]; } ]); &lt;/script&gt; &lt;/head&gt; &lt;body ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div class=&#34;container&#34;&gt; &lt;div&gt; &lt;div id=&#34;dvContainer&#34;&gt; &lt;div&gt; &lt;div class=&#34;table-responsive &#34;&gt; &lt;table id=&#34;dvData&#34; cellpadding=&#34;12&#34; class=&#34;table table-bordered&#34; style=&#34;margin-left: 20px; margin-right: 20px;&#34;&gt; &lt;tr class=&#34;success&#34;&gt; &lt;th&gt;&lt;b&gt;Id&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;File&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Actions&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr ng-repeat=&#34;state in terms&#34;&gt; &lt;td&gt;{{state.Id}}&lt;/td&gt; &lt;td&gt;{{state.Resume.split(&#39;/&#39;)[state.Resume.split(&#39;/&#39;).length-1]}}&lt;/td&gt; &lt;td&gt;{{state.Name }}&lt;/td&gt; &lt;td&gt;&lt;a target=&#34;_blank&#34; href=&#34;Files/{{state.Resume.split(&#39;/&#39;)[state.Resume.split(&#39;/&#39;).length-1]}}&#34;&gt;Link&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre>https://www.aspforums.net:443/Threads/574732/Preview-file-on-AnchorLink-Click-in-AngularJS/https://www.aspforums.net:443/Threads/574732/Preview-file-on-AnchorLink-Click-in-AngularJS/Fri, 09 Aug 2019 05:13:41 GMT