Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Problems Opening Files From Non-Alpha 5 Folders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problems Opening Files From Non-Alpha 5 Folders

    Hi guys,
    I've finally got my Alpha 5 website up live for beta testing. I've been having a problem that I can't figure out and it seems to happen with all types of files.

    My database contains a file location and I want a user to be able to open that file to view it. The problem is that if I set up a button to do it or make that field in the grid a link I get the same result. It works on my computer in preview, but not when I'm running live off of the app server over the web. This is kind of maddening because since it worked on my computer I thought all this stuff would work, the previews can be very deceiving this way.

    Here's an example:
    My DB contains this file location: \\DNCSERVER\machine\CL150\232-D-OP1-214
    This location is on a different server than the one with Alpha 5 installed.

    It works fine when I click a button to this link or the link itself in Working Preview. I get a web browser window with the file open in it. When I try it running the web app it doesn't do anything. I can copy and paste the link into the browser and it works fine. It doesn't seem to matter what file type.

    There has to be a setting somewhere that I'm missing, please help me get this working.

    Thanks!

    ETA: I should add that if I instead make a button to DOWNLOAD the file, that works fine.
    Last edited by -Jinx-; 10-08-2012, 10:33 AM. Reason: addition

    #2
    Re: Problems Opening Files From Non-Alpha 5 Folders

    We might need to see how you are trying to open the file, what is under your button. But the physical address you show would ONLY be available inside your firewall if you were trying to open it up directly in the browser. E.g., it would be meaningless if I tried to open that in my browser address here in my office.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Problems Opening Files From Non-Alpha 5 Folders

      Hi Steve,
      Yes, you're right; it would be meaningless for anyone else to try to open it. It's on another server in our LAN. When users access my alpha 5 web app off site they will be doing so through a VPN.

      I've got a button set up to run the action javascript: "open an .a5wpage, static HTML page, URL, or PDF document..." The page URL in the setup for the action javascript is "file:///{filename}" (I've tried this a few different ways). This button works perfectly in Live Preview or Working Preview but just pops up with a blank window when I'm running it live. I've tried other external websites and it works. I've even tried using our intranet site http://www3.companyname.com That works too. It just won't open up a file running live.

      ETA: It does NOT come up with a "this page cannot be displayed". It is a blank window.

      Also I can log onto the server running the application server and type "\\DNCSERVER\machine\CL150\232-D-OP1-214" into internet explorer. It pulls up the file just fine.
      Last edited by -Jinx-; 10-08-2012, 11:42 AM.

      Comment


        #4
        Re: Problems Opening Files From Non-Alpha 5 Folders

        Use response.sendfile() instead. Here is an A5W page that I call just like you are doing. The page takes parameters location and filename.


        dim location as c
        dim filename as c
        dim path as c

        select
        case location = "A5Folder"
        path = "\a5\\"
        case location = "Webroot"
        path = filename_decode(Request.ApplicationRoot)
        case location = "Data"
        path = filename_decode("[PathAlias.ADB_Path]\\")
        end select

        openfile = path + filename

        if file.exists(openfile) = .f.
        ?"<script>alert('File not found');</script>"
        else
        response.sendfile(openfile,.t.)
        end if
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: Problems Opening Files From Non-Alpha 5 Folders

          Originally posted by Steve Wood View Post
          Use response.sendfile() instead. Here is an A5W page that I call just like you are doing. The page takes parameters location and filename.
          Steve,

          I'm sorry but your suggestion is beyond me at the moment. You'd have to explain it in detail...where to put it, how to get the file location from the grid to the a5w page...etc.

          Please take no offense because I don't mean any, but every time I ask a question on this forum I seem to get a response to do custom code. I bought this software so I wouldn't have to code and this is a simple thing that Alpha should do. There's nothing code worthy about this problem. Is this a bug or is there something stupid that I'm doing that isn't working right? Aren't there some kind of tests I can do to locate the issue?

          Once again, if I make a button to DOWNLOAD the file it will work; even running it live, however it won't OPEN it in a window, tab, or seperate browser window except in Working Preview or Live Preview.

          Comment


            #6
            Re: Problems Opening Files From Non-Alpha 5 Folders

            I cannot make it work from a live website either. Someone else is going to have to comment about how or if the file:/// syntax works online, I am not an expert with that syntax. But you should also try turning off security on your web app and try again. If that makes it work, then visit the web project control panel and find Web Security > Page Security and make sure your file type is in the File types always allowed, and publish. Although the most common web file types are always allowed (htm, a5w, pdf, etc), others are automatically prohibited as a default and have to be allowed.

            Back to my method, take the code in my previous post and place it in an A5W page. Then call that page from your button with a URL such as in my attached image. In my example I have a "location" parameter, but you can hard code that on the A5W page if the filename always includes the full path. You can see that my A5W page code deals with the possibility that the file is not found whereas your simple file:/// does not take that into account.

            Finally, the reason the File Download utility you mentioned works is because Alpha has written the code for you. There is no File Open utility, so that is the reason you might have to write some code in this case. I know it is a hallmark of Alpha's advertising, but it is unlikely you can write a custom web application without writing some code.
            Attached Files
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: Problems Opening Files From Non-Alpha 5 Folders

              Thanks Steve,

              I'm trying your solution now but the first time I tried it I get a "file not found" error which is probably the one in your code then this pops up in my Window:
              Code:
              dim location as c dim filename as c dim path as c select case location = "A5Folder" path = "\a5\\" case location = "Webroot" path = filename_decode(Request.ApplicationRoot) case location = "Data" path = filename_decode("[PathAlias.ADB_Path]\\") end select openfile = path + filename if file.exists(openfile) = .f. ?"" else response.sendfile(openfile,.t.) end if
              I've probably got something screwed up but I'm not sure where yet. I'll keep trying. I think that since I have a full path I should simplify the code you provided but that will take me some time to figure out.

              ETA: All I really need is filename...mine is the complete path with the filename.

              P.S. I've got security set to allow all file types while I'm messing with this.
              Last edited by -Jinx-; 10-08-2012, 02:41 PM. Reason: addition

              Comment


                #8
                Re: Problems Opening Files From Non-Alpha 5 Folders

                OK, I figured out that I had to put the code inside of this:
                Code:
                 <%a5 ... %>
                Correct? When I tried it written inbetween those tags with a simplified version of your code it kind of works. It asks me if I want to open or save the file. That is the same thing as when I make it download a file. It doesn't appear to work any differently except it makes the popup window and nothing goes into the window. After you open it or save it, the window stays up with nothing in it. If I ask it to open a new browser window the button doesn't do anything at all.

                Idealy, I'd like to open my file in a popup window or another pane in my tabbed ui.

                Comment


                  #9
                  Re: Problems Opening Files From Non-Alpha 5 Folders

                  Since you know your path you can simplify your code to below. Also see attached, I confirmed you can use // syntax to find files. Now, the reason I force a path (choice of three - webroot, data folder or c:\a5 folder) is I do not want the user to have full access to the entire server/LAN!

                  dim filename as c

                  if file.exists(filename) = .f.
                  ?"<script>alert('File not found');</script>"
                  else
                  response.sendfile(filename,.t.)
                  end if
                  Attached Files
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: Problems Opening Files From Non-Alpha 5 Folders

                    <<I'd like to open my file in a popup window or another pane in my tabbed ui>> You can control that in the onClick options, tell it to open the tabbedui or page. I happened to choose a DIV in my example.

                    I dont really have an answer for the "prompt to save" problem. I actually asked that question about a month ago and here is the response. I have the same problem as you in this regard:

                    The issue here is that the only way to set the name of the file being downloaded is to prompt to save. There is no way in HTTP to specify the filename without the save prompt, as it is done with the same HTTP header. This means that if you request download.a5w and it does not prompt to save, the correct content will be sent, but if the browser is configured to save automatically, it will typically use download.a5w as the file name. IE however considers the MIME type when saving the file and will use the expected file extension.

                    In summary, if you want to control the name of the file when it is saved, you must prompt to save.
                    Steve Wood
                    See my profile on IADN

                    Comment


                      #11
                      Re: Problems Opening Files From Non-Alpha 5 Folders

                      Thanks again Steve,

                      Unfortunately, it acts just like a download. I tried having it open a new browser window or a DIV but then the button doesn't work at all. If I have it go to a popup window it works as a download but leaves the window sitting there with nothing in it. What I ended up doing was using the shortened version of your code and told it to open a dropdown window. I sized the dropdown window to 1px x 1px so you can barely notice it on the screen and since it's a dropdown, it goes away when a user clicks again. With your help and the workaround I am now able to fix a different problem....The file download doesn't work when a file doesn't have an extension. your code and my dropdown window workaround does work for files without extensions.

                      Once again, thanks for the help. Although it's not what I'd like, it's working at least. It sure would be nice to know why stuff works in the previews but not live....even when you can enter the exact same // syntax in your browser to call up the files.

                      Comment


                        #12
                        Re: Problems Opening Files From Non-Alpha 5 Folders

                        Did you try a different browser by chance or a different computer to test it?

                        Comment


                          #13
                          Re: Problems Opening Files From Non-Alpha 5 Folders

                          Originally posted by pettechservices View Post
                          Did you try a different browser by chance or a different computer to test it?
                          Yes and yes. Even had someone try with safari.

                          Comment


                            #14
                            Re: Problems Opening Files From Non-Alpha 5 Folders

                            What if you view source, do you see any information in there? Did you submit a bug report to Alpha, as it could be a bug?

                            Comment

                            Working...
                            X