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

Is there a way to List Folder Contents?

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

    Is there a way to List Folder Contents?

    I want to give the ability to my users to open files in folders I designate for my web app. I want them to be able to upload to this location as well. Any direction you can provide is much appreciated!

    Thank you!

    #2
    Re: Is there a way to List Folder Contents?

    Do you want to give them full directory browsing or search by filename, keywords, access to only certain files, etc?

    If the latter, when files are uploaded, you'll want a column in a table with the relative file path, e.g. Documents/mydoc1.doc (which is physically at C:\MyWebrootFolder\Documents\mydoc1.doc). Then in a grid, you can either make this column a hyperlink or you can use Action Javascript to open a "webpage" where the filelocation is {FilePath}.

    Code:
    FileID|FileClientID|FileType|FilePath
    1     |65          |Contract|Documents/mydoc1.doc
    2     |456         |Invoice |Documents/Invoices/myinvoice.pdf

    There's Action Javascript for uploading as well. Read up on that.

    Comment


      #3
      Re: Is there a way to List Folder Contents?

      Full directory browsing would be fine

      Comment


        #4
        Re: Is there a way to List Folder Contents?

        I don't actually allow that on our application, so you'll have to read up on Directory Browsing (search the forum, documentation).

        Comment


          #5
          Re: Is there a way to List Folder Contents?

          I do a similar thing, but before I go into a lengthy explanation, I'd like to see if this is what you mean...
          My client has projects and each project has it's own project directory. Inside that are 5 sub-directories. The pic shows two of the 5. The action buttons at the bottom allow files to be uploaded and downloaded. Note that there is no table, this is a display of what is in the directories. So, there is no searching and no filtering available.
          Capture1.PNG
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            Re: Is there a way to List Folder Contents?

            Pat,

            That is exactly what I am looking for.

            Comment


              #7
              Re: Is there a way to List Folder Contents?

              Josh,

              OK, we'll go through this step by step....it'l take a few posts to get it all laid out.
              First, what you see in the pic is a grid. Like I said, there are 5 sub-directories, so I have 5 dropdown controls, one for each sub-directory. The controls are set up like this:
              Capture1.PNG
              Mine are 25 rows high because that's what fits on my client's screens.
              The static text is, for example, "<span style="font-size:10pt;font-weight:bold;">ClientDocs Directory</span>"
              and the button labels are set up like "<img src="led-icons\arrow_up.png" />&nbsp;Upload To ClientDocs"

              The dropdown choices are set up as a variable that holds a crlf delimited list of choices, for example a variable named "ClientDocsList"
              The variables, in turn are defined in the OnGridExecute server side event, for example

              vPath = "c:\enefen\000_NFN_Projects"
              vProjectname = Session.JOBNAME

              vCDFilelist = filefind.get(vPath+chr(92)+vProjectname+chr(92)+"ClientDocs\*.*",FILE_FIND_NOT_DIRECTORY,"N")
              if vCDFilelist = ""
              e.rtc.ClientDocsList = "No files found"
              else
              e.rtc.ClientDocsList = vCDFilelist
              end if

              vINFilelist = filefind.get(vPath+chr(92)+vProjectname+chr(92)+"Inspection\*.*",FILE_FIND_NOT_DIRECTORY,"N")
              if vINFilelist = ""
              e.rtc.InspectionList = "No files found"
              else
              e.rtc.InspectionList = vINFilelist
              end if

              and so on.

              When you get that done, I'll show you the buttons
              Pat Bremkamp
              MindKicks Consulting

              Comment


                #8
                Re: Is there a way to List Folder Contents?

                Pat,

                Do you store information in a table that you base your grid on? Just wondering how you create the controls in the grid if they are not bound to a table. Sorry for the dumb question and thanks for your help!

                Comment


                  #9
                  Re: Is there a way to List Folder Contents?

                  Hey Pat,

                  I've got this working. Would you be willing to show me the code for the buttons to upload/download?

                  Thank you!

                  Comment


                    #10
                    Re: Is there a way to List Folder Contents?

                    Josh,
                    Sure. For upload, I use the File Upload - User Defined action javascript set up like
                    Capture1.PNG

                    The server side event, then is just
                    function saveInClientDocs as v (e as p)
                    vPath = "c:\enefen\000_NFN_Projects"
                    vProj = Session.JOBNAME
                    for i = 1 to e.fileCount
                    if e.fileArray[i].file.dataType = "text"
                    file.from_string(vPath+chr(92)+vProj+chr(92)+"ClientDocs"+chr(92)+e.fileArray[i].fileName,e.fileArray[i].data)
                    elseif e.fileArray[i].file.dataType = "binary"
                    file.from_blob(vPath+chr(92)+vProj+chr(92)+"ClientDocs"+chr(92)+e.fileArray[i].fileName,e.fileArray[i].data)
                    end if
                    next
                    e.javascript = "window.parent.{grid.object}.refresh();"
                    end function

                    For download, I use the File Download action javascript set up like
                    Capture2.PNG

                    Code for that is
                    function getFromClientDocs as c (e as p)
                    dim vPath as c
                    dim vProj as c
                    dim vFileName as c
                    vPath = "c:\enefen\000_NFN_Projects"
                    vProj = Session.JOBNAME
                    e.ajaxCallBackType = "FileDownload"
                    vFileName = vPath+chr(92)+vProj+chr(92)+"ClientDocs"+chr(92)+e._currentRowDataNew.dir_ClientDocs
                    e.fileToDownload = vFileName
                    e.javascript = "{grid.object}.isDirty=false;"
                    end function
                    Pat Bremkamp
                    MindKicks Consulting

                    Comment


                      #11
                      Re: Is there a way to List Folder Contents?

                      Pat this is a really slick solution for handling files in a web app. Thank you for sharing it!

                      Comment


                        #12
                        Re: Is there a way to List Folder Contents?

                        Pat,

                        I am hoping for some advice. I am using a dialog (is that ok) and am able to populate the list of documents...Works great.

                        The difference in my application is that I can't base the file bath on a session variable because I am displaying documents based on selections from a drop down list. I am using javascript to reload the page with the projcode and lot variables and am then using the request variable method inside of the onDialogInitialize event to create the path and populate the document list.

                        My issue is that I can't use the request variables inside of the ajax callback for downloading and uploading. Can you think of a way for me to handle this? I was wondering if I can use a request variable to create a session variable? I was also wondering if e._currentRowDataNew.dir_ClientDocs will work inside of a dialog? I don't know if I have access to the same objects in this type of ajax callback. I looked at the prototype and it looked pretty limited and that may be why youre using a grid?

                        Comment


                          #13
                          Re: Is there a way to List Folder Contents?

                          Josh,

                          Sorry, I can't answer your questions because I don't use a dialog. The reason I don't use a dialog is because it didn't offer the file upload_user defined ability. If that had been available, I'd rather have used a dialog.

                          Pat
                          Pat Bremkamp
                          MindKicks Consulting

                          Comment


                            #14
                            Re: Is there a way to List Folder Contents?

                            Understood, Thanks

                            Comment

                            Working...
                            X