Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

.sql files not opening

  • 05-09-2007 9:55am
    #1
    Closed Accounts Posts: 2,616 ✭✭✭


    Hi,
    I have developed a web app where documents may be uploaded onto a server, and then opened of downloaded from the server by the users. Every type of file can be opened and downloaded apart from .sql. The main types of files that are uploaded are .txt, .dox, .pdf, .xls and .psd (photoshop), they all work apart from .sql
    just wondering does somthing different have to be done for .sql files?
    Regards,
    Frank


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    .sql files are just text files. There's nothing to them.

    We need more information on the problems you're actually experiencing.


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    ^^What Seamus said: What webserver is this running on? What language? Can you show us the exact code you're using to handle the uploads?


  • Closed Accounts Posts: 2,616 ✭✭✭8k2q1gfcz9s5d4


    yea, thats what i thought.
    The application is for storing Resolutions to IT problems (like a help desk), each resolution can have documents attached to it.
    I am bring back a collection of "documents" that are associated with a resolution. A foreach loop goes through the collection, and for every document, creates a hyperlink to the location of the document on the server, the text on the hyperlink is the name of the document.

    the upload works fine, the hyperlink is created and points to the correct location, but when it is clicked i get a page not found error. This only happens with .sql files

    this is the mothod for creating the hyperlink

    its done in c#. the uploading of the files onto the server is working
    private void CheckForDocument(int intResolutionID)// check to see if a document has been attached
    		{
    			StringBuilder sb = new StringBuilder();
    			ResolutionDocumentLookupSearch myResolutionDocumentLookupSearch = new ResolutionDocumentLookupSearch();
    			ResolutionDocumentLookupCollection myResolutionDocumentLookupCollection = myResolutionDocumentLookupSearch.SearchForAttachedDOcument(intResolutionID,"SUPPORT");
    
    			foreach(ResolutionDocumentLookup lookupDoc in myResolutionDocumentLookupCollection)
    			{
    				DocumentSearch myDocumentSearch = new DocumentSearch();
    				Document myDocument = myDocumentSearch.FindByID(lookupDoc.DocID,"SUPPORT");
    				if((myDocument.DocExtention ==".pdf")||(myDocument.DocExtention ==".PDF"))
    				{	// if the attachment is a .pdf
    					sb.Append("<a class=\"tabDrill\" href=\"/SupportTools/Docuverse/_Upload/" + myDocument.Name + myDocument.DocExtention +"\" target=\"_blank\" >" + myDocument.Name + "<BR>");
    				}
    				else
    				{	// if the attachment is a .doc/.txt/.sql
    					sb.Append("<a class=\"tabDrill\" href=\"/SupportTools/Docuverse/_Upload/" + myDocument.Name + myDocument.DocExtention +"\" target=\"_blank\" >" + myDocument.Name.ToString() +"<BR>");
    	
    				}
    			}
    			this.litAttachments.Text = HttpUtility.HtmlDecode(sb.ToString());
    
    			if(myResolutionDocumentLookupCollection.Count ==0)
    				this.lblDocument.Visible = false;
    		}
    


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Hi,
    I have developed a web app where documents may be uploaded onto a server, and then opened of downloaded from the server by the users. Every type of file can be opened and downloaded apart from .sql. The main types of files that are uploaded are .txt, .dox, .pdf, .xls and .psd (photoshop), they all work apart from .sql
    just wondering does somthing different have to be done for .sql files?
    Regards,
    Frank

    This sounds like an end-user problem. If I read your post correctly, the end-users are downloading the various files from your website, correct? And you are saying .txt, .pdf and so on are openening on their end correctly? If that is the case, then the end-user has to assosiate .sql files with notepad or something to open them.


  • Closed Accounts Posts: 2,616 ✭✭✭8k2q1gfcz9s5d4


    tom dunne wrote:
    This sounds like an end-user problem. If I read your post correctly, the end-users are downloading the various files from your website, correct?
    yea,

    .sql is associated with .txt on my machine, and its not working on mine either.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Could it be that you don't have a MIME type for .sql files configured on your webserver?


  • Closed Accounts Posts: 89 ✭✭euph


    I have a webapp creating .sql files here (under the webapp's root directory) and sql files open up within the browser, as would textfiles.

    tomcat 5.5, no specific configuration for sql files?

    Something that may or may not be relevant:
    If I open a .sql file from a local directory (ie outside of browser), it is associated with Oracle SQL Developer which opens it, but a dialogue box *still* appears saying the file could not be found.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    As Phil says, maybe try adding a specific MIME type for .sql files.

    If this is IIS, then there may very well be some obscure built-in security settings that prevent remote users from downloading or executing certain types of files - .sql files would raise alarm bells most of the time.

    I've seen IIS do things like this before - If you add a subfolder to the root, named something like "mydomain.com", then attempting to access http://myserver/mydomain.com will result in a 404. My guess has always been that this is because ".com" is a registered executable extension.

    In fact, now that I've remembered that, I'd almost bet money on this being some security feature in IIS.

    /me goes off to test


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    I would hazard a guess that euph's webapp is opening .sql files in the browser and not in a Save As... dialog for a similar reason.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Just tested it on IIS on our intranet server.

    Attempting to access .sql file ends in a 404. Add a MIME type for .sql as text/plain, and it opens in the browser.

    Nice one Phil. :)

    Edit: Just changed it to "application/rtf" and it prompts to download the file. Nice.


  • Advertisement
Advertisement