navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Document management

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Document management
Page: [1]
 
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
Document management - 11/17/2005 8:00:52   
Does anyone know of any good sites with stuff about document management?

What I want is to hide the source of the doc, hide urls, stream it to the client etc etc.

I'm looking for big-picture stuff, I'm not worried about the languge, I'll be writing it in c#, but I'm most interested in the concepts - so that when I start coding there's not an important aspect I've not thought about/planned for.

Any help is much appreciated.
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Document management - 11/17/2005 11:54:24   
I've been playing with an ASP script from Spooky that prompts a download for a file, without showing the source URL...

something like that?



_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: Document management - 11/17/2005 16:47:03   
yes something like that. It's difficult finding anything on the web using the words "file", "download" and "url" in search engines!:)

If you've got that script or any thoughts on the subject I'd be really interested to hear them.


Just found this by luck - very good comments. It's in VB.NET but good stuff nonetheless.

(in reply to bobby)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Document management - 11/17/2005 17:29:03   
<%@ Language=VBScript %>
<%Response.buffer=True

'///////////////////////////////////////
'// This is the server path to your files (it WILL need changing)
'///////////////////////////////////////

filePath = "c:\http_root\file\"

'///////////////////////////////////////
'// First, see if the user has logged in
'///////////////////////////////////////

'///////////////////////////////////////
'// Request file name from link query string
'///////////////////////////////////////


fileName = request.querystring("file")

'///////////////////////////////////////
'// Log the download
'///////////////////////////////////////

' Insert logging code here
' Eg - record the user and download in a seperate dataabse / text file


'////////////////////////////////////////
'// Send the file.
'// The file is sent to the user, using the code "download.asp?f=filename.ext"
'// So, if the file is called setup.zip, youll use a link "download.asp?f=setup.zip"
'//
'////////////////////////////////////////


Response.ContentType = "application/asp-unknown"
Response.AddHeader "content-disposition","attachment; filename=" & fileName
Set FStream = Server.CreateObject("ADODB.Stream")
FStream.Open()
FStream.Type = 1
FStream.LoadFromFile(filePath&filename)
Response.BinaryWrite FStream.Read()
FStream.Close
Set FStream = Nothing
Response.End

'////////////////////////////////////////
%>





_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: Document management - 11/17/2005 19:20:31   
Thanks Bobby, looks very similar to the one on the link - that's helpful, means I have to think less! :)

Here's what I've come up with, possibly a few holes but I'm certainly no expert on VB to C# (or even just c#!)

private void Page_Load(object sender, System.EventArgs e)
		{
                     //put an if block around SendFile2Stream to satisfy your auth levels

                     //pass the querystring with the filename to the method
			SendFile2Stream(Request.QueryString[0]);			
		}

              //method for sending the file to the output stream
		private void SendFile2Stream(string filename)
		{
                     //declare local variables
			FileStream fs = null;
			byte [] bytBytes = null;

                     //try block
			try
			{
                            //open the filestream to the document
                            //note" Configuration.WebsiteDocsPath is a class-property I've got to get useful keys from the                  
                            //web.config
				fs = new FileStream(Configuration.WebsiteDocsPath + filename, FileMode.Open, FileAccess.Read);
                            //create a byte array of doc's length
				bytBytes = new byte[fs.Length];
                            //read the filestream into the array
				fs.Read( bytBytes, 0, Convert.ToInt32( fs.Length ) );
			}
                     //should be some catch blocks here!!!

                     //don't cross the streams! :)
			finally
			{
				fs.Close();
			}

                     //add the headers
			Response.AddHeader( "Content-disposition", "attachment; filename=" + filename );
                     //pick a content type
			Response.ContentType = "application/octet-stream";
                     //write the doc to the output stream
			Response.BinaryWrite(bytBytes);
                     //end
			Response.End();
		}//end method


It worked for me so far...but

I didn't add any exceptions yet as I'm sure there are lots and lots for the file/stream objects and I don't want to mislead anyone by leaving them out/just using the general exception. I also left out the authorization "if", as that can be sorted out according to one's own fascist desires (I've got a few of those).


(in reply to bobby)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Document management
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts