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

Strip path from file reference ?

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

    Strip path from file reference ?

    Using a file type field, is there a way not to store the path with the filename ?

    from c:\folder\imgName.jpg to imgName.jpg

    #2
    Re: Strip path from file reference ?

    Unfamiliar with "file type field".

    Code:
    ? file.filename_parse("c:\folder\imgName.jpg","NE")
    = "imgName.jpg"
    There can be only one.

    Comment


      #3
      Re: Strip path from file reference ?

      Originally posted by Slap View Post
      Using a file type field, is there a way not to store the path with the filename ?

      from c:\folder\imgName.jpg to imgName.jpg
      Fred

      Welcome to the Alpha community..

      I did a search on help and found this link to the filename parse.
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


        #4
        Re: Strip path from file reference ?

        If you are using an image file reference field and are asking how to make the application portable you can

        keep the images in the same directory as the database - no path is stored
        "Just Cause-02.jpg"

        keep the images in a subdirectory of the database - relative path is stored
        "pics\Just Cause-02.jpg"

        keep the images in a known location and have the end user create the same location - valid path is stored
        "\Program Files\Movienizer\Covers\Just Cause-02.jpg" - local drive
        "N:\Just Cause-02.jpg" - non local drive

        give the user a process to specify where the images can be found and update the image file reference field to use the specified location -path is updated
        Last edited by Stan Mathews; 08-27-2008, 01:48 PM.
        There can be only one.

        Comment


          #5
          Re: Strip path from file reference ?

          Ok I realize this was not clear enough and I understand a bit more now, sorry, I am really new to Alpha Five.

          I am working with active link tables, my setup is alpha v9 and I use it as a front end to MySQL.

          I do not have an image reference field as such, I am only storing the reference in a MySQL varchar field, I usually do that with php.

          In this case it does not seem to store relative path, I set up a subdirectory as you suggested but it keeps storing the full path and I only need the file name.

          Thanks

          Comment


            #6
            Re: Strip path from file reference ?

            Use

            file.filename_parse("drive:\directory\filename.jpg","NE")

            to yield


            "filename.jpg"
            There can be only one.

            Comment


              #7
              Re: Strip path from file reference ?

              Originally posted by Slap View Post
              Ok I realize this was not clear enough and I understand a bit more now, sorry, I am really new to Alpha Five.

              I am working with active link tables, my setup is alpha v9 and I use it as a front end to MySQL.

              I do not have an image reference field as such, I am only storing the reference in a MySQL varchar field, I usually do that with php.

              In this case it does not seem to store relative path, I set up a subdirectory as you suggested but it keeps storing the full path and I only need the file name.

              Thanks
              Why not just store the image in mySQL? Works a treat from mySQL and from Alpha5 WAS pages, desktop etc. And no issues with file paths etc...

              Comment


                #8
                Re: Strip path from file reference ?

                Maybe I am old fashioned, but I like to keep them out of the db.

                But only fools do not change their mind ;) just not convinced yet.

                Comment


                  #9
                  Re: Strip path from file reference ?

                  I have to admit I am a bit lost as to where to implement the code listed above.

                  Comment


                    #10
                    Re: Strip path from file reference ?

                    You can't strip the drive and path from an image reference field and just store it there. That is contrary to the definition of the field.


                    If you want to define a character field and just store the filename and you have the full path somewhere, file.filename_parse() with the indicated parameters will yield the filename and extension. I can't tell you where to use the expression because I don't know enough about what you have now.
                    There can be only one.

                    Comment


                      #11
                      Re: Strip path from file reference ?

                      Originally posted by Stan Mathews View Post
                      You can't strip the drive and path from an image reference field and just store it there. That is contrary to the definition of the field.
                      Nope, the script Richard posted does exactly that and it works fine as long as the images exist relative to the database path. Unless I misunderstood your post...

                      Comment


                        #12
                        Re: Strip path from file reference ?

                        Who is Richard and what script?

                        I've probably lost sight of the original question. If the images are relative to the database path there is no drive and path info stored and then it can't need to be stripped. If not, stripping the drive and path would destroy the info Alpha needs to locate them.

                        At least that's what I meant to say.
                        There can be only one.

                        Comment


                          #13
                          Re: Strip path from file reference ?

                          Originally posted by Stan Mathews View Post
                          Who is Richard and what script?
                          Richard Rabins posted code on how to convert image references to relative paths some time ago, I'm trying to find the post...

                          I don't know about forms but in web grids you can definitely specify a relevant path for image reference fields.

                          Comment


                            #14
                            Re: Strip path from file reference ?

                            Here you go - I will have to bookmark that thread cos this isn't the first time I spent ages looking for it! https://forum.alphasoftware.com/show...ghlight=images

                            Comment


                              #15
                              Re: Strip path from file reference ?

                              OK, a little background.

                              We specialize in programming online applications in lamp environment, since we have more and more clients requesting that we take care of their local systems, I am evaluating alpha (been through access and filemaker).

                              We mainly intend to use it as a local frontend to our databases (MySQL) while keeping our cms and online solutions.

                              Last year, following one of our client's request, we have sucessfully translated a (rather large and complicated) ms access database to MySQL while keeping their in-house frontend (developed over years by the client) but that road was not painless, and it is not very easy to get support from MS (rather impossible), not a problem with the MySQL folks, they are behind you and support is good.

                              We also evaluated Filemaker pro, but that is kind of a joke, they advertise a 'partnership' with MySQL but we are far from a perfect integration and support over here in Belgium is .... not efficient ... would be a nice way of putting it.

                              So we have good hope for Alpha five.

                              And this would explain why I am such a noob regarding syntax, scripting etc etc etc, I only have spent a few hours on it, but we have to make a fast decision.

                              The product pretty much convinced us anyway, and this 'problem' is not that important, we can always name the files properly and not even need to store their references, but this would be nicer 'user friendly wise'.

                              --------------------------------------

                              What I wanted to try out was to store a file reference in the table.

                              Normally I would do that using online forms, take the filename, strip it, replace spaces with underscores, replace accented characters (French) by their 'un-accented' equivalent, upload the file on our server, and store the ref in the db.

                              So I have a character field ready, I just need a button with a file dialog and store the name of the file, if that is feasible of course, files will be uploaded by ftp, we do not need alpha to take care of that part.

                              Thanks for all your input.

                              Comment

                              Working...
                              X