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

URL Calculation Works in Live Preview, Not in Browser

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

    URL Calculation Works in Live Preview, Not in Browser

    Hi,

    I think this is simple but I'll let the jury decide. Is this a bug or a faulty implementation, or even worse, a browser "feature"?

    I have a calculated field on a grid component that creates a url to point to a local audio file -- e.g. calculated link = "file://c:\a5avfiles\record1.mp3".

    In "Live Preview", the Media Player responds with the correct file.

    On the webpage from the browser (IE 7), the calculation results in a garbled url as follows = "file:///c:/a5avfiles/record1.mp3"...

    That is, all the file_path back-slashes (\) are reversed to forward-slashes (/) and an extra forward-slash appears after "file://"???

    Many thanks for taking a peek at this. Cheers, +/Chuck

    #2
    Re: URL Calculation Works in Live Preview, Not in Browser

    How have you defined the link in the web component, and what path is it actually stored in? It looks like it is defined as a file link but sort-of-locally...

    Comment


      #3
      Re: URL Calculation Works in Live Preview, Not in Browser

      Hi Andrea,
      Not sure what you mean by "How have you defined the link"... it is defined as a link field that gets the link address from a calculated field and yes, the audio files for each record are on the server host in a separate directory = c:\A5AVFILES.

      Does that clarify things per your question. Thanks for responding, +/Chuck

      Comment


        #4
        Re: URL Calculation Works in Live Preview, Not in Browser

        Originally posted by iandsdb View Post
        Hi Andrea,
        Not sure what you mean by "How have you defined the link"... it is defined as a link field that gets the link address from a calculated field and yes, the audio files for each record are on the server host in a separate directory = c:\A5AVFILES.

        Does that clarify things per your question. Thanks for responding, +/Chuck
        I guess a better question would have been how is the link calculate...

        Since the link directory points to a folder outside of the web directory (a5Webroot), you can't just link to the files that way... if you want them available in the webroot, you have to put them in a folder that is below/within your website's directory, e.g a5webroot/MyApp/MP3 or similar.

        Alternatively, you could code a page that retrieves the file and temporarily copies it to the session folder of a user, but for now, just try putting the files where the web app can actually see them, e.g. within the directory on the server that you are publishing to...

        Comment


          #5
          Re: URL Calculation Works in Live Preview, Not in Browser

          Hi Andrea,
          No soap. I moved the A5AVFILES directory under A5Webroot and the URL calculation still has the same symptoms as previously mentioned (reversed back-slashes in file pathname and an extra forward-slash after the url header "file://"). The Live Preview continues to work correctly, however.

          Any other clues? Thanks, +/Chuck

          Comment


            #6
            Re: URL Calculation Works in Live Preview, Not in Browser

            Ignore the fact that it works in Live Preview, you don't use "file:" anything to link your mp3 file. Your link, or URL, will look like this:

            <a href="http://www.mydomain.com/mymusic.MP3">Click here to listen</a>

            or using a relative address:

            <a href="mymusic.mp3">Click here to listen</a>

            In xbasic, it can take forms such as here where both values are variables:

            ?”<a href=\””+myurlvar+\””>”+mydisplayvar+”</a>”


            Or here where the values are manually inserted:

            ?”<a href=\"http://www.mydomain.com\”>mymusic.mp3</a>”

            In the above examples, the files do have to be in the document root OR on some other web server if you use the full URL address starting with http.
            Last edited by Steve Wood; 05-13-2008, 08:26 PM. Reason: doc root
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: URL Calculation Works in Live Preview, Not in Browser

              Hi Steve,
              Thanks for the instructions. I am trying to create the format you suggested in "Expression Builder" using the following:

              AV_URL = "<a href="+chr(34)+alltrim(nspeakerbureau->Av_file_path)+chr(34)+">"+IF(left(right(alltrim(nspeakerbureau->Av_file_path),4),1)=".","Play","n/a")+"</a>"

              This yields a calculated URL like the following:

              <a href="c:\A5Webroot\MyAppFldr\soundfile.mp3">Play</a>

              when there is a sound file pathname in the field "Av_file_path".

              After much experimentation, I do not seem to be able to create a reference that works in Av_file_path. I have moved the sound file around to the root directory, etc. Can you elucidate a bit further, please?

              Much appreciated by an old mainframer (read that ex-APL prgmr) finding his way in a new world... +/Chuck

              Comment


                #8
                Re: URL Calculation Works in Live Preview, Not in Browser

                I should take one step back and ask if you are creating a web application where the only user will be you on your computer, or your staff on a company LAN. Because in those two cases, it is possible to use the local folder syntax you are attempting to use. That is, c:\a5webroot\...soundfile.mp3 will work as a "URL" only on a browser on your computer; and similar syntax for a LAN.

                But if you are attempting to make this sound file available on the www, your URL syntax is completely wrong, continued below...

                What you are missing is that the URL has to be such that I could type in my browser and find your file. If I were to type c:\a5webroot\...soundfile.mp3 in my browser it would try to find something on my computer.

                So your URL will have either a domain name (like alphatogo.com) or an IP address as the base. It will look like http://www.alphatogo.com/downloads/angryguy.mp3. Or, there will be an IP address instead of the domain. (Real mp3 on my site. Angry wrong-number message left on my office answering machine. Quite humerous but a little pathetic.)

                If you do not have a public IP address, then nothing you do will allow anyone else to access this sound file.

                If you do not have a public IP, but do want others to access your web application, look at www.no-ip.com.

                Also, if your application is using the Security Framework (I don't think you are or your first post would report different problems), then be sure to add "mp3" to the always allowed files under Page Security.

                A last point: based on what I explained here, anyone will be able to access that sound file based on the URL. There will be no protection at all. If you want to protect the file, then you have to do some magic. Andrea suggested a copy method, but I would use a method that involves the function file.to_blob(). But we can save that for another day:).
                Steve Wood
                See my profile on IADN

                Comment


                  #9
                  Re: URL Calculation Works in Live Preview, Not in Browser

                  Hi Steve,
                  Thank you for the clarifications! I thought I had security implemented but notice that the fields (grid columns) do not seem to be restricted as I expected. Oh well, a problem for another day as I am trying to demo the application this weekend.

                  For the demo, the local files will be fine but as you have indicated, the live application will require the different approach. I have used no-ip for demo access without the sound file option as, of course, I couldn't get it to work that way.

                  Your time and valuable information is greatly appreciated. +/Chuck

                  Comment

                  Working...
                  X