Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by vchris

  1. So what's the damage doc?Tried to update or add a mod and everything borked?
  2. I noticed that in IE6 (don't have IE7 at work) instead of prompting to download the doc filename, it prompts to download the name of the page that gets the doc (doc_fetcher, no extension) but I can still open this word doc with word manually. Any idea why?EDIT: my bad, typo in content-type for word files.
  3. I currently don't use any database. There are so little logins that I simply have them hard coded in the page. I'm not sure I want to create one.
  4. Could a user go up one level if my path is hard coded except for the file name?This is the kinda path I have: /absolutepathtofolder/group/file.doc. This path is outside of the web folder. You mean that someone could change my querystring to ?myFile=../othergroup/file.doc and access another file? Is this valid then /absolutepathtofolder/group/../othergroup/file.doc since this is how it will be displayed. I could also simply not allow / in the querystring.
  5. They can't type a direct url to the file since the file is stored on the server outside of the web folder. Only ColdFusion can get in there and get the file. I made a coldfusion page that will fetch the file. The user has no idea where the file is. There is only a querystring (?myFile=test.doc). The current problem with this is all the files are all in one folder so if a user from one group knows the name of a file from another group, he could access it with the querystring. I'll be adding the group folders so this won't be possible. I know how to do this part. Thanks anyway for the code.
  6. I got another idea to improve the security of the files for this website. Since a user could download any file if he knows its name. On logon, I could set a session variable of the group the user is from. Then have a folder for each group within the docs folder. That user can then only download a file from his folder.
  7. Works awesome! Thanks skemcin
  8. No worries I built my own. It's working great.Is there any way I can know if a file is not found? I got it working with the querystring right now (?myFile=test.doc). If someone were to manually enter ?myFile=testd.doc it'll still try to download but could I have a message say file not found instead of downloading a blank doc?
  9. It works. Did you find that script about the mime types?
  10. Maybe start by validating your xhtml first.
  11. wow that's weird. I'm looking at it and it's not even in the source code... I'm trying to find out why.edit: the weird thing is when you hover the lower contact us it underlines to higher one.
  12. I'd go that way any day over what I got now. Unfortunately I'm not allowed to use XML at work. I got standards to meet and XML doesn't... Kinda stupid if you ask me but that's the government. At least we're up to xhtml strict now.
  13. using ../../test.doc didn't work. It is the correct path. I can probably find out in which drive I am and use absolute path.
  14. I guess this has to do with the path to the docs being incorrect or something? I used relative paths (../../test.doc) since I don't know the absolute path from the drive.
  15. Any good place for some skins?
  16. I've been playing with your script skemcin and I download the file, it's great, except that the file I download is blank. If I create a test.doc file with "This is a test document" in it. After downloading I got nothing same with other 4mb docs.
  17. Uploading on vchris server!
  18. I rarely, if ever, used <cfscript>. Is it handled by javascript?
  19. Finally phpbb3 is out today! So who's getting it? Who's got info on it? bla bla bla...I'll probably test it on my site see how it is.
  20. Thanks I'll try that probably tomorrow. I'll let you know.Wouldn't the function be just a bunch of cases?case "doc":case "xls":...
  21. ok so cfheader will load the doc, but will it load the application in the browser or will it ask to download? So the content-type needs to be set accordingly each time right? I can open pdf, word, excel, zips...? I want users to be asked to download each time if possible. I don't want to content of the file to be read and then displayed on the webpage without the app.
  22. vchris

    Domain name

    Except that it depends on the url entered by the user. I need to know what the user wants to access. Does he want to access the root website or the subroot website? The .htaccess wouldn't be able to know that right? I'd rather use a .htaccess file than javascript.
  23. I have this pretty big ul list. This list has 3 levels. For instance Data Users is lvl1, Search for pollutant Releases is lvl2 under Data Users and Web Maps is lvl3 under Data Users and Search for... Then you can have other lvl1, lvl2 or lvl3. I only need to use this list on about 9 different sections of the site so some of the section of the list won't be shown but might be in the future. Let's say you are on Web Maps page, the navigation should open Data Users then Search for pollutant Releases and highlight Web Maps. I'm already creating the list with a 2 dimensional array and for loop. It creates it nicely except when it comes to opening a certain section of the ul. <cfparam name="selected" default="" /><cfparam name="visibility" default=' style="display: none;"' /><cfparam name="lastlvl" default="" /><cfparam name="navlist" default="" /><cfset myNav = ArrayNew(2) /><cfset myNav[1][1] = "Home" /><cfset myNav[1][2] = "##" /><cfset myNav[1][3] = "lvl1" /><cfset myNav[2][1] = "Data Users" /><cfset myNav[2][2] = "##" /><cfset myNav[2][3] = "lvl1" /><cfset myNav[3][1] = "Search for Pollutant Releases" /><cfset myNav[3][2] = "##" /><cfset myNav[3][3] = "lvl2" /><cfset myNav[4][1] = "Web Maps" /><cfset myNav[4][2] = "##" /><cfset myNav[4][3] = "lvl3" /><cfset myNav[5][1] = "NPRI Databases" /><cfset myNav[5][2] = "##" /><cfset myNav[5][3] = "lvl2" /><cfset myNav[6][1] = "Criteria Air Contaminants (CAC)" /><cfset myNav[6][2] = "##" /><cfset myNav[6][3] = "lvl2" /><cfset myNav[7][1] = "1990 - 2015 CAC Emission Summaries" /><cfset myNav[7][2] = "##" /><cfset myNav[7][3] = "lvl3" /><cfset myNav[8][1] = "CAC Emission Outlook" /><cfset myNav[8][2] = "##" /><cfset myNav[8][3] = "lvl3" /><cfset myNav[9][1] = "2000 CAC Emission Maps" /><cfset myNav[9][2] = "##" /><cfset myNav[9][3] = "lvl3" /><cfset myNav[10][1] = "Data Analysis" /><cfset myNav[10][2] = "##" /><cfset myNav[10][3] = "lvl2" /><cfset myNav[11][1] = "NPRI Lists of Substances" /><cfset myNav[11][2] = "##" /><cfset myNav[11][3] = "lvl2" /><cfset myNav[12][1] = "NPRI List of Substances" /><cfset myNav[12][2] = "##" /><cfset myNav[12][3] = "lvl3" /><cfset myNav[13][1] = "Toxic Substances (CEPA)" /><cfset myNav[13][2] = "##" /><cfset myNav[13][3] = "lvl3" /><cfset myNav[14][1] = "Alternate Threshold Substances" /><cfset myNav[14][2] = "##" /><cfset myNav[14][3] = "lvl3" /><cfset myNav[15][1] = "Criteria Air Contaminants" /><cfset myNav[15][2] = "##" /><cfset myNav[15][3] = "lvl3" /><cfset myNav[16][1] = "Reporting Facilities" /><cfset myNav[16][2] = "##" /><cfset myNav[16][3] = "lvl1" /><div id="sidenav"> <cfloop index="i" from="1" to="#ArrayLen(myNav)#"> <!--- Create list ---> <cfif i GT 1> <!--- if same lvl ---> <cfif right(lastlvl,1) - right(myNav[i][3],1) EQ 0> <cfset navlist = navlist & '</li>' /> <!--- if lower lvl ---> <cfelseif right(lastlvl,1) - right(myNav[i][3],1) EQ -1> <!--- Make sublist visible ---> <cfif section EQ myNav[i-1][1]> <cfset navlist = navlist & '<ul>' /> <cfelse> <cfset navlist = navlist & '<ul style="display:none;">' /> </cfif> <!--- if higher lvl by 1 ---> <cfelseif right(lastlvl,1) - right(myNav[i][3],1) EQ 1> <cfset navlist = navlist & '</li></ul></li>' /> <!--- if higher lvl by 2 ---> <cfelseif right(lastlvl,1) - right(myNav[i][3],1) EQ 2> <cfset navlist = navlist & '</li></ul></li></ul></li>' /> </cfif> </cfif> <!--- Add selected class ---> <cfif section EQ myNav[i][1]> <cfset selected = ' class="selected"' /> </cfif> <cfset navlist = navlist & '<li><a href="#myNav[i][2]#"#selected#>#myNav[i][1]#</a>' /> <cfset selected = "" /> <cfset lastlvl = myNav[i][3] /> </cfloop> <cfset navlist = '<ul>' & navlist & '</li></ul>' /> <cfoutput>#navlist#</cfoutput></div> I was thinking of setting a variable on each page that tells my script to open the sublist but it's getting really complex. The problem with this is when it comes to adding a new sublist item or moving items around, it's kinda complicated for someone else. This might not be the best way to display the list, if you know of a better way to create it and open only a specific section on certain pages let me know.EDIT: Actually I found a way for it to work. I created 3 variables. 1 for lvl1, lvl2 and lvl3. Seems to work nicely. Only thing I don't like is the huge array...
  24. vchris

    Domain name

    I probably forgot to mention this but our server is a virtual server (shared by many users). This created a bit of a problem this morning when trying to set up the domain name. I had an error 400 - bad request but called my host and it works. Now for the redirection, using cgi.http_host doesn't give my the new domain name, it gives me the default one from my host since it's a virtual server. Using cfdump, I don't see any cgi variable that contains what I need. I currently have a javascript redirecting, since it's browser side, I get the correct window.location.href value. We are probably going to swap our 2 sites so we won't need to redirect but if there is an easy coldfusion fix to the redirection let me know.
  • Create New...