A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: csv path problem with server / and \

  1. #1
    Senior Member
    Join Date
    Mar 2006
    Posts
    191

    csv path problem with server / and \

    I have a general server question:

    In my csv file are picture paths like c:\picture\info.jpg
    when I upload the csv file to my server the path should be: http://www.domain.de/picture/info.jpg

    If I copy the complete folder to the server I have the problem with slash and backslash in my csv file and there is no domain like http://www....

    How can I solve this Problem! Is there a possibility to create a serverfolder with the right path like http://www....
    so that I can link from my local system to this path and at the end the server finds the pictures and the local system to?

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Do a serach and replace, remove the c: and replace \ with / via script look at the string functions

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Unfortunately flash doesn't have an easy replace function.
    In this case the easiest way may be to use a temporary array.
    Assuming the filename is in a variable named filename you can do it like this
    Code:
    tmpArray = filename.split(String.fromCharCode(0x5c));
    tmpArray[0] = 'http://www.domain.de';
    filename = tmpArray.join(String.fromCharCode(0x2f));
    The first line splits the string in an array using \ as a delimiter.
    The second line replaces the first item c: with your domain.
    The third line combines it to a string again but this time with / as a delimiter.

    If you don't want the domain name in it you can use
    tmpArray.shift();
    as the second line to remove the first array item.
    Last edited by w.brants; 04-15-2006 at 01:11 PM.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Neat trick Wilbert...

  5. #5
    Senior Member
    Join Date
    Mar 2006
    Posts
    191
    Happy Easter Wilbert and Bret...
    thanks for your postings...

    I will test it after Easter...
    Great Help

  6. #6
    Senior Member
    Join Date
    Mar 2006
    Posts
    191

    CSV Table with Filter...???

    Some difficult questions to Wilberts "great" csv solution:

    Is there a possibility to show more than one entry at the same time? (like a table with images of the csv)? At this time the listbox has hundreds of entries and the user must click on each entry to get information: To Find out where the right information is, is not easy! That means a lot of clicks...I already sorted all entries and made more csv files, but it is not realy user friendly.
    Now, I changed the csv File with some Category Fields:
    1. main category
    2. Category 2
    That means, each entry of the csv File has now a special Category Field 1 and a Category-Field 2

    My questions:

    If I have for example 2 Listboxes to choose:
    1. (Listbox 1) Main-Category and 2. (Listbox 2) this Second Category

    Is there a possibility to filter now all the csv entries with Listbox 1 and Listbox 2 (Filter Text) and show the result in a table like an overview with pictures?

  7. #7
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    The easiest way to show more then one entry at the same time might be to use a html text with links and images in it.

    Filtering could be done using a loop to go through the array and use a comparisson function to select only the items you want.

  8. #8
    Senior Member
    Join Date
    Mar 2006
    Posts
    191
    Thanks Wilbert,

    ... I think your Advice to loop is the way...
    I will learn it.. 2 years later...

    I don't know if this is possible with KM:
    1. create a textfield e.g. (searchtxt) with all keywords like..Nr, Infos..of the csv... this searchtxt.visible = false
    2.
    Then...a button which shows the searchfield e.g.
    searchtxt= InputBox("my Searchtext ")
    3.
    Then
    listbox1= my Searchtext

    ...it is difficult to explain in english I hope you understand what I mean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center