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



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

How do you prevent Publish from deleting data folders?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you prevent Publish from deleting data folders?

    Hello. We are deploying our first AA web app under IIS that allows users to upload files. I thought using a folder like "\inetpub\<ourdomain>\uploads" for this purpose would keep the website and all related data files within inetpub. However, whenever I publish to the server, the "uploads" folder gets deleted. I presume the AA deployment process does a complete erase and re-upload of the website image and thus the "uploads" folder goes away. Is it "best practice" to upload user data to a folder under inetpub or should I be uploading to another folder outside of inetpub on the server (e.g. c:\<ourdomain>\uploads) instead?

  • #2
    Re: Data folders under inetpub in IIS

    It depends on what you need. I've done it both ways. I've set up inetpub like this:

    if you create a folder under default.webproject and put a dummy file in it, it will copy up when you publish.


    • #3
      Re: Data folders under inetpub in IIS

      Thanks, Lee. It looks like anything I put into "myproject", including any subfolders, do indeed get uploaded when I re-publish. However, the process also wipes out any live data that may have been added to those folders on the server since the last time I published. Apparently all of the files in "myproject" and its subfolders are treated as static data and completely replace the entire contents of inetpub for my website.

      I just stumbled on using a Virtual Directory to store the files my users upload. That way, I can have an "uploads" folder under my website in inetpub that is physically located elsewhere on the server hard drive. But, I just discovered that when I republish, the contents of the virtual directory still gets erased. So, I guess I just don't know how to prevent republishing in AA from erasing my data folders at this point...


      • #4
        Re: Data folders under inetpub in IIS

        It's possible I need to go into the "Preserve web.config Elements" option in the Publish Profile and tell it not to touch the "uploads" folder on the server. This is uncharted territory for me, so I will see if I can find out anything more through trial and error...Alpha documentation is minimal on this...


        • #5
          Re: Data folders under inetpub in IIS

          I use both methods. Both work fine. If you use the directory structure from above it will never get over-written.


          • #6
            Re: Data folders under inetpub in IIS

            I must be missing something because the entire "c:\inetpub\<myproject>" folder on the server gets wiped out and recreated from my local machine whenever Alpha republishes under IIS. That includes my "uploads" folder, resulting in the loss of all data files users have uploaded since my last publish. It doesn't seem to matter whether I physically setup the "uploads" folder under <myproject> or as a virtual directory elsewhere on the server. Either way, it gets wiped out and recreated using the current image on my local machine.

            How do you prevent the Alpha publish process from erasing and recreating the uploads folder? Any thoughts?


            • #7
              How do you prevent Publish from deleting data folders?

              This thread was originally started at
              ...but the title may not have been clear enough...

              Whenever Alpha republishes under IIS, the entire "c:\inetpub\myproject" folder on my server gets wiped out and recreated from my development machine. That includes my "c:\inetpub\myproject\uploads" folder, resulting in the loss of all data files users have uploaded since my last publish. It doesn't seem to matter whether I physically setup the "uploads" folder under "\myproject" or as a virtual directory elsewhere on the server. Either way, it gets wiped out and recreated using the current image on my local machine.

              How do you prevent the Alpha publish process from erasing and recreating the "uploads" folder, or how do you keep it from erasing the entire "\inetpub\myproject" folder whenever you republish? Thanks for any help you can offer!


              • #8
                Re: Data folders under inetpub in IIS

                I think it's in your publishing profile. SnipImage.JPG I have it set this way. On my test IIS Server I have several websites. So I set them up this way.


                • #9
                  Re: Data folders under inetpub in IIS

                  If you have a sub-folder that you always want to publish then (see screen capture) put it in this area and put at least one dummy file in the folder and it will always publish.PublishSubDirectory.JPG
                  Attached Files
                  Last edited by lvasic; 04-29-2017, 05:01 PM. Reason: updated picture


                  • #10
                    Re: Data folders under inetpub in IIS

                    Thanks, Lee!!! Yes, for some reason I didn't see how I could just change the publish profile to move the static site files down one level to something like wwwroot like you did. Now I have the site at \inetpub\myproject\wwwroot and the uploaded user data files in \inetpub\myproject\uploads. It works perfectly now!

                    On to the next issue...not sure if you have ever used the Image Gallery component, but it seems to go into an endless wait state when I load it. It's not giving any error message, is showing the thumbnail file names but not the actual images, and never gets past the "spinning circle" where the main image normally appears...

                    Anyway, thanks again so much for helping me work through this! I am most grateful!!!


                    • #11
                      Re: Data folders under inetpub in IIS

                      Where are your pictures located? It may be a path issue.


                      • #12
                        Re: Data folders under inetpub in IIS

                        I upload images to c:\inetpub\myproject\uploads and move (rename) them to c:\inetpubs\myproject\uploads\<currentid>. Thumbnails get created in c:\inetpub\myproject\uploads\thumbs and get moved (renamed) to c:\inetpub\myproject\uploads\thumbs\<currentid>. The complete filename of the images is stored in a SQL database and I verified that the entries are correct and the files are physically where they should be. I am displaying images in a list and, when you click on the list, it opens the Image Gallery component in a modal window. It all works fine on my development PC, but on the server the Image Gallery seems to stay in a perpetual wait state, just showing the "circle wait icon". The thumbnails at the bottom of the component show the correct image filenames but no images. It's almost as if the images can't be opened. I've checked permissions for the uploads folder, thinking that might be the issue, but users have full access rights. I've just tried setting the Image Gallery up on a separate web page, using the default "Images" folder shipped with Alpha, and it displays the default thumbnails and images properly. Tomorrow, I'll try setting it up to use my own data folders and see if that works. Maybe I just need to open the Image Gallery on a separate web page rather than within a modal window...


                        • #13
                          Re: How do you prevent Publish from deleting data folders?

                          I don't understand why you are renaming the currentID. Do you use the PathAlias? Example: [] = C:\inetpub\mywebsite1\wwwroot\pics\


                          • #14
                            Re: How do you prevent Publish from deleting data folders?

                            No, I couldn't figure out how to use PathAlias to accomplish this. I want images that users upload to be stored in different folders, depending on the "currentid" they are referencing. I have a UX with an image field and a button that calls the "Image Upload" Action Javascript process. The upload folder is set to "uploads" as in the above example. There are other descriptive fields in the same component and a "Commit" button that references the "Update, Insert or Delete Data" Action JS process. I could not seem to locate or trap the place in the code where the filename was set prior to upload, so I just decided to rename the image file and related thumb afterward, by calling a "renameImageFiles" function via the "Insert-After insert" server-side event. That works just fine and results in the correct locations for the uploaded files, both on my development machine and the IIS server.

                            After the commit process, I return to another page with a UX containing the main image list control, where I can successfully browse all of the uploaded image files with no problem. The image filenames are stored in a table and can be displayed in the list control. The issue is, I setup an on-click event on the list control to open the Image Gallery in a browser window. I know I have the proper path set to the <currentid> folder, because the image filenames appear in the thumbnail areas at the bottom of the image gallery, but not the images themselves. I know the image gallery component gives an "invalid folder" error if the path is not correct. So, it looks like it's successfully loading the list of files in the thumbs folder but not opening them. The image gallery just stays in a perpetual wait state. I'm thinking it's a permissions issue, but don't know why, if the component can load the directory contents and I've set all of the permissions for the "users" account to full control on the uploads folder and all its subfolders.

                            I could try setting the filenames prior to upload, but couldn't get that working. The help info for the "Upload folder" on the Image Upload properties screen says you can use a session variable to specify the upload folder, which I originally tried, but it never worked for me. If I entered session.UploadFilename as the upload folder, it would resolve to "c:\inetpub\myproject\session.UploadFilename" and place the image files there. I also thought I could use a transformation expression but couldn't get that to work either. Not sure what to do at this point...


                            • #15
                              Re: How do you prevent Publish from deleting data folders?

                              Back to the drawing a website under IIS always results in the complete webroot folder being deleted first, which means all subfolders, including any user photos that may have been uploaded into them, is erased too. If I put the data files outside of the webroot, a list control can access them, but Image Gallery cannot and I cannot reference any of the image files within, say, the body of an email. Does anyone know of a way I can tell the IIS publish process NOT to upload a specific folder under webroot or at least not to delete the entire webroot folder before re-publishing?