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

Error when debugging Session.SaveDataAsFile

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

    Error when debugging Session.SaveDataAsFile

    I'm trying to make a call to Session.SaveDataAsFile from a Dialog component in Live Preview mode. I'm running the debugger and as soon as it executes the Session.SaveDataAsFile function it returns the following error:

    Prop_not_found.JPG

    Here is the code I am using:
    Code:
    debug(1)
    dim FileKey as c = "MyFile.txt"
    Session.SaveDataAsFile(FileKey,"Hello World, this is a session file")
    I can see a Session object with various member variables:

    Session.JPG

    Does anyone know if it is not possible to debug Session.SaveDataAsFile() in Live Preview or Working Preview mode?

    I get no errors when I call Session.FormatFileDataURL().

    Thanks

    #2
    Re: Error when debugging Session.SaveDataAsFile

    this will work in livepreview. it will NOT work in working preview as there is not session object in working preview.

    you need to condition your code on whether you are in live preview or working preview.
    to test if you are in live or working preview you can use this internal function.

    a5w_FlagWorkingPreviewOrPreview()

    it returns .t. if you are in working Preview or preview mode.
    preview mode is NOT live preview mode!!

    Comment


      #3
      Re: Error when debugging Session.SaveDataAsFile

      I am using Live Preview mode as I mentioned in my post. I never use Preview mode.

      I added a5w_FlagWorkingPreviewOrPreview() to prove that I am running in Live Preview mode.

      Capture.JPG

      It's also obvious that I'm using Live Preview mode because of the contents of the Session object. The objects are initialized differently depending on which mode you are using. Below is the error you would get if you were using Working Preview. Notice the error message is different than the one I am getting in Live Preview.

      Property not found Session.SaveDataAsFile method not found.
      Last edited by DaveF; 12-28-2012, 03:16 PM.

      Comment


        #4
        Re: Error when debugging Session.SaveDataAsFile

        Dave,

        I don't see it working in live preview mode either using your example. I get the same error message.

        The old method does work in live preview.
        Code:
        dim Filename as c = "MyFile.txt"
        save_to_file("Hello World, this is a session file",Session.Session_Folder + Filename)
        Jim Coltz
        Alpha Custom Database Solutions, LLC
        A5CustomSolutions.com
        [email protected]

        Comment


          #5
          Re: Error when debugging Session.SaveDataAsFile

          Jim,

          This is my first attempt at storing temporary files on the web server. I began using A5 after the release of version 11 and according to the release notes, the Session.Session_Folder property has been removed and the new methods Session.SaveDataAsFile and Session.FormatFileDataURL() should be used instead. Are you still able to use the deprecated Session.Session_Folder property?

          Comment


            #6
            Re: Error when debugging Session.SaveDataAsFile

            Originally posted by DaveF View Post
            Jim,
            Are you still able to use the deprecated Session.Session_Folder property?
            Session.Session_Folder still works, at least through per-release build 3147-4060. Deprecated usually means it will go away eventually so you may want to get to the bottom of the problem with session.SaveDataAsFile() instead of relying on a deprecated property. I don't know why session.SaveDataAsFile() isn't working. I can't seem to get it to do anything but error out in live preview, with the same error you get.
            Jim Coltz
            Alpha Custom Database Solutions, LLC
            A5CustomSolutions.com
            [email protected]

            Comment


              #7
              Re: Error when debugging Session.SaveDataAsFile

              This is a bug in Alpha which will be fixed. You can also use the following workaround
              Code:
              dim FileKey as c = "MyFile.txt"
              [B]dim FileData as b
              FileData = "Hello World, this is a session file"[/B]
              Session.SaveDataAsFile(FileKey,FileData)

              Lenny Forziati
              Vice President, Internet Products and Technical Services
              Alpha Software Corporation

              Comment


                #8
                Re: Error when debugging Session.SaveDataAsFile

                Thanks Lenny. That worked! I tried something similar to this last week and it still failed. The reason was because I used a character data type instead of a blob data type. There is no documentation available for any of these new Session methods.
                Last edited by DaveF; 01-02-2013, 03:08 PM.

                Comment


                  #9
                  Re: Error when debugging Session.SaveDataAsFile

                  Lenny,

                  Do you know how I can get the local path name to the file that SaveDataAsFile creates? I need the local path for downloading and sending emails with atachments.

                  Thanks

                  Comment


                    #10
                    Re: Error when debugging Session.SaveDataAsFile

                    Not sure this the cleanest way, but it has been working for me since a few days now.

                    "http://" + request.host + "/A5SessionFile/" + xfdffile is the URL for downloading.

                    "/A5SessionFile/" + xfdffile is the server side file.

                    In your case xfdffile would be the "MyFile.txt"


                    Originally posted by DaveF View Post
                    Lenny,

                    Do you know how I can get the local path name to the file that SaveDataAsFile creates? I need the local path for downloading and sending emails with atachments.

                    Thanks
                    Richard
                    --------------------------------------------------------
                    Find the Good and Praise It
                    Alex Haley

                    Comment


                      #11
                      Re: Error when debugging Session.SaveDataAsFile

                      When is the ETA for this fix?

                      I'm experiencing the same problem, but it is not consistent.
                      When I use the 'b' data type, my resulting saved XML has parsing issues.
                      When I save the XML from the 'b' data object manually with Notepad, the parsing issues disappears.

                      However when I use the 'c' data type, the XML is Ok, but I sometimes get the problem described above by Dave,
                      basically one of the test XMLs is working the other is not.


                      Originally posted by Lenny Forziati View Post
                      This is a bug in Alpha which will be fixed. You can also use the following workaround
                      Code:
                      dim FileKey as c = "MyFile.txt"
                      [B]dim FileData as b
                      FileData = "Hello World, this is a session file"[/B]
                      Session.SaveDataAsFile(FileKey,FileData)
                      Richard
                      --------------------------------------------------------
                      Find the Good and Praise It
                      Alex Haley

                      Comment

                      Working...
                      X