Current location: Hot Scripts Forums » Programming Languages » ASP.NET » open word file in a specific asp.net page


open word file in a specific asp.net page

Reply
  #1 (permalink)  
Old 06-27-08, 10:13 AM
mariowowo mariowowo is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
open word file in a specific asp.net page

Got a gridview with links to word files. When click on one link I want to open this word file in another asp.net page called wordFile.aspx. Can I do that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-28-08, 02:47 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
You sure can. What you need to do is to pass the file name through URL. For security reasons, I recommend that you not include the extension, so if you have worddocument.doc, just pass "worddocument".

You will need to customize your grid, so for the example above, you would need a link to a page like this:

Code:
wordFile.aspx?page=worddocument
On your wordFile.aspx page:
  1. Check the passed file name for special characters, to make sure no malicious characters are passed to your page. I recommend only allowing a-z, A-Z, 0-9 characters.
  2. Put together the file name (worddocument + . + doc = worddocument.doc).
  3. Check for existance of the file in the directory.
  4. If file exists, redirect to the file to open it.
That should do it for you. Let me know if you need more detail.


Pete
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmer Needed for File hosting script! Fabolous Job Offers & Assistance 3 06-15-06 11:56 PM
How do i open a file? xxvatarxx PHP 6 05-21-06 02:30 PM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 05:28 PM
How to open a file?? bonnie ASP 10 06-17-03 06:14 AM


All times are GMT -5. The time now is 09:13 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.