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

File Upload to Amazon s3 errors

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

  • File Upload to Amazon s3 errors

    I have spent over 20 hours now. I am trying to migrate from local hosting to the cloud and in doing so, I have had to migrate to Amazon RDS for the Database. This was successful but I am stuck trying to set up and upload files to Amazon S3. Everything I have tried results in an error related to security settings. After ~20 hours, I am willing to pay a consulting fee for anyone willing to work with me to solve this. Please respond with private message.
    Thanks
    Steve

  • #2
    Are your S3 CORS setup per Alpha's instructions? If you're not sure what CORS is that might be the issue.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

    Comment


    • #3
      I believe so. Here is what I have set

      [
      {
      "AllowedHeaders": [
      "Content-Type",
      "x-amx-acl",
      "origin"
      ],
      "AllowedMethods": [
      "PUT"
      ],
      "AllowedOrigins": [
      "*"
      ],
      "ExposeHeaders": [],
      "MaxAgeSeconds": 3000
      }
      ]

      Comment


      • #4
        Hi Steve I am having and have been having a similar problem. I have spent about the same amount of time as you and I have been looking and willing to pay for support. Where I'm at, is if I make the bucket public I can upload and download. If I make the bucket private I can only download with the following CORS and Bucket settings. I have tried a hundred variations of these policies with the same result, Access denied on upload.

        If you find someone who can figure this out let me know. I'll do the same.





        Bucket policy
        {
        "Version": "2012-10-17",
        "Statement": [
        {
        "Sid": "Stmt1619377508586",
        "Effect": "Allow",
        "Principal": {
        "AWS": "arn:aws:iam::9999999999:root"
        },
        "Action": "s3:PutBucketPolicy",
        "Resource": "arn:aws:s3:::bbbbbb"
        }
        ]
        }



        Cors Policy

        [
        {
        "AllowedHeaders": [
        "Content-Type",
        "*",
        "*"
        ],
        "AllowedMethods": [
        "PUT"
        ],
        "AllowedOrigins": [
        "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
        }
        ]

        Comment


        • #5
          Am I missing something here? My bucket policy is empty, my bucket is set to block ALL public access, and I can easily copy files to my bucket using

          a5storage_copyfiles("MyStorageStringName","C:\aFolderName\aFileName.doc")

          AmazonBucketPolicy.png
          Jay Talbott
          Lexington, KY

          Comment


          • #6
            Hi Jay,

            So when I try to run that function it tells me it's not available and it dosen't show on the function list in xbasic. (i'm on build 7295) although the function is in the documentation.

            On a positive note I did get the a5storage_saveFile() function to work. The function works with or without a bucket policy. Have you tried the action javascript FileUoload function as that is what is not working for me.

            For now I'm going to build around the a5storage_saveFile() function.

            I wish I knew more why some of these things work and others don't.

            Also, just for comparison what do you have for a CORS policy?

            Thanks
            tom

            Comment


            • #7
              Hi Jay,

              So I've run into a block on using the a5storage_saveFile(). I want the end user to upload the file which means I need the fully qualified path of the file and it seems you can't get that through the browser. Although there must be someway that Alpha gets that for it's own upload functions. Do you know of a method to get the full filename and path or are you just using this to move files from the Alpha server to S3?

              Thanks
              Tom

              Comment


              • #8
                It appears the function I mentioned is not available in 7295. The documentation says it is available in 4.6.2.7 + versions. 7295 is 4.6.2.6.

                I got the action javascript to work in 7704. When I opened the same component in 7295, it also worked. For what it's worth, I attached it below. You need to either rename your connection string to match mine in the Action Javascript, or vice versa.

                My CORS policy is the same as yours.

                Hope that helps.
                Jay

                jsFileUpload_06012021.zip
                Attached Files
                Jay Talbott
                Lexington, KY

                Comment


                • #9
                  Jay,

                  Thanks, for this. I imported you file and updated the data connection to match my set up and got the same error. I suspect the problem is the security settings in my S3 though I don't know how. As you noted, the CORs policy shouldn't be the problem

                  Steve

                  Comment


                  • #10
                    So using Firefox I was able to see more detail on the request headers. What I found is the following

                    I believe the origin and referer have to match exactly. So what I see is an extra slash on the Referer.

                    This is from the File Upload S3 action javascript method. I don't know if this is the issue but I have passed it on to Selwyn.

                    Comment


                    • #11
                      CORS issue solved.

                      With Selywn’s help we have a configuration that works for secure upload and download on signed URL’s.

                      S3 Settings
                      1. PUBLIC ACCESS – On the public access dialog in Block Public Access for all but the first option. So you are allowing access granted through new access control lists.

                      Block all public access
                      Off
                      Block public access to buckets and objects granted through new access control lists (ACLs)

                      LEAVE ALL OTHERS TURNED ON - GREEN

                      1. Remove any Bucket specific policies This should be empty. Maybe it's me, but when I try to add a bucket policy I get CORS errors on upload.
                      2. Use one of the CORS settings.

                      For testing from localhost I suggest a wildcard configuration on the Allowed Origin, see below. For production you can lock it down with the specific domain https://example.com. In this configuration requests will only be accepted from the specified domain (it won’t work from localhost). There are methods for adding local host that you can find on the Internet. I find it just as easy to go into S3 and update the CORS.
                      Code:
                      [
                      {
                      "AllowedHeaders": [
                      "Content-Type",
                      "x-amz-acl",
                      "origin*"
                      ],
                      "AllowedMethods": [
                      "PUT"
                      ],
                      "AllowedOrigins": [
                      "*"
                      ],
                      "ExposeHeaders": [],
                      "MaxAgeSeconds": 3000
                      }
                      ]

                      Comment


                      • #12
                        Thanks for getting back to us. Glad it's sorted.
                        Pete
                        Insanity: doing the same thing over and over again and expecting different results.
                        Albert Einstein, (attributed)
                        US (German-born) physicist (1879 - 1955)

                        Comment


                        • #13
                          I should add that if you don't lock down the Public ACCESS then anyone with a formatted URL can upload or download from your S3 storage location.

                          Comment


                          • #14
                            No Joy Here... I get a error code but the description of the error is truncated to the point that I can't derive the details. Tom would you be willing to look at my setup and help for a fee?

                            Comment


                            • #15
                              Just send you a PM. Happy to take a look NC

                              Comment

                              Working...
                              X