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

Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

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

    Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

    I am using the builder "Open an .a5w page, static HTML page, URL, or .pdf document...." to open a .pdf file stored in a folder, in a pop-up window.

    The file is c:\Alpha5\FreightZone\Documents\test.pdf

    In the builder the PDF filname is \Documents\test.pdf.

    It gives an error "404 Not Found. The requested URL /Documents/test.pdf was not found on this server."

    Even if I hard code the path and file name, I still get he error.

    I can download the same file with no problem, I just can't open it in a pop-up window with the builder.

    I get the same result on a development machine and on a Local Lan machine.

    I recently set up both machines from scratch. On the previous machines this was working. All machines running Win 7.

    Is there a security setting that needs to be set up somewhere? Any ideas are welcome.

    #2
    Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

    Apparently the builder "Open an .a5w page, static HTML page, URL, or .pdf document...." is only looking at files or folders within the Webroot folder.

    I am not sure if this is a result of my publishing settings, or if it is a built in feature of AA.

    a5.get_path() is returning c:\Alpha5\FreightZone

    But the builder is looking in c:\Webroot\FreightZone + \Documents\test.pdf where "\Documents\test.pdf" is the only entry in PDF filename section of the builder.

    Comment


      #3
      Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

      Yes... it's all relative to the published target folder. It's a web thing. As far as I know you're not allowed to load a local resource... which would be your c:\Alpha5\etc. a5.get_path() is more of a desktop process which returns the path of the currently opened database. It's handy, but not really applicable here.

      Depending on your security settings you may also run into security issues. I don't know how your development environment is set up. My development files, for example, are in the Default.WebProject folder. Create a folder under this named FreightZone\Documents and put your test.pdf in there. If you have security running then, within Alpha, set security for the FreightZone folder and publish. Drill into FreightZone and set security for Documents and publish.

      You could also use S3 to store your PDFs and load them from there.

      Comment


        #4
        Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

        It is easy to serve files outside root folder in Alpha Anywhere using Node. You just need require 'http' and 'fs' and then you create a Node server serving 'Content-Type': 'application/pdf'.
        (You need to write the node_service file self there is no builder available.)

        Comment


          #5
          Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

          If a5.get_path() is not applicable, why are the aliases in Web Project Profile for both the Local Webroot and the Local Lan set to [PathAlias.ADB_Path] = =a5.get_path()?


          In the "File Upload to the Server" builder, in the "Upload Folder" section, the help notes say "If you enter a folder without a drive letter, the folder is assumed to be in the webroot."

          I have entered: \Documents

          In the Web Project Profile for Local Lan, I have this path: \\Ws1\c\A5Webroot

          So when I execute an upload, I expect the file to upload to c:\Webroot\Documents on the Local Lan machine.

          But when I upload a file to the Local Lan, it ends up in c:\Alpha5\FreightZone\Documents, which is not in the webroot.



          The builder "Open an .a5w page, static HTML page, URL, or .pdf document...." will only look in \\Ws1\c\A5Webroot.



          Obviously, I do not understand how this works.

          Comment


            #6
            Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

            After watching some videos and spending a lot of time on this, I have made some progress.

            I made sure that I am publishing to identical paths on both the Local Webroot and Local Lan.

            I moved my Documents folder where I am uploading and downloading to a folder within the webroot.

            Also it is important to understand the File Download builder - Folder Name - is "relative to the Application Root" so it always starts with the root that is specified in Web Project Profile.

            The Open an .a5w page builder asks for a File Name. It also starts in the webroot.

            So the syntax to find the correct file in the two builders may differ, depending on how you specified the webroot path in Project Profiles.

            Now I can open a file in a pop-up window, or download the file.


            The only problem I still have is specifying the Allowed Download folders in Project Properties.

            The help for Allowed Folders say I can use <ApplicationRoot> as a placeholder. My ApplicationRoot is C:\A5Webroot\FreightZone\

            So I should be able to use C:\A5Webroot\FreightZone\Documents or <ApplicationRoot>Documents

            In both cases it throws a message that I am trying to download from a folder that is not allowed.

            If I leave Allowed Folders blank, it works, but that is not acceptable.

            Any ideas?

            Comment


              #7
              Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

              In Web Project Settings my Target Folder for publishing is AlphaTest which means I'm publishing to e:\A5Webroot\AlphaTest

              In Project Properties my File Download, Allowed Folders is set to <ApplicationRoot>\Documents

              In my UX, I'm using the File Download action and I specify an Absolute Filename (for my tests). The filename is Documents\test.pdf

              This works since I have a folder on my server... e:\A5Webroot\AlphaTest\Documents... which contains the test.pdf file.

              Comment


                #8
                Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

                David, I set up a test identical to yours, and it works just fine.

                I failed to mention earlier that the file download type I am using is the ReferencedFilename, rather than the absolute file name.

                So I put a text control on the UX called testDownload.

                In the download builder > Fieldname (referenced file) I put testDownload

                In Folder name I put \Documents

                In Project Properties my File Download, Allowed Folders is set to <ApplicationRoot>\Documents

                The referenced file name action returns "File was not in a folder from which downloads are allowed"

                If I remove <ApplicationRoot>\Documents, it works flawlessly. It will open any file name I put in the testDownload control.

                And the absolute action works in either scenario, as it should.

                Perhaps you can reproduce this?

                Thanks for your help!

                Comment


                  #9
                  Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

                  You're very close. Your ReferencedFilename setting is ok, but your Folder name of \Documents is off a bit. This does not point to a relative folder. You need just Documents here... no backslash.

                  And with Project Properties set to <ApplicationRoot>\Documents it all works.

                  Comment


                    #10
                    Re: Open an .a5w page, static HTML page ... or pdf file returns 404 Not Found error

                    I believe I have my issues straightened out. I had some permission problems on the Local Lan machine I was publishing to. I had previously tried the Referenced file name/folder with and without the backslash, and it didn't work. It works now with no backslash.

                    Once again, David, thanks for your help.

                    Comment

                    Working...
                    X