0

Can I use importfile() to pull in a local file instead of web file?

I'm trying to use

importFile(this, "file:///users/....") . to add a file as an attachment without luck (on a mac)

Does file:/// work?  - all the examples I found use http: instead - wondering if I can pull in a local file?

6 replies

null
    • Birger_H
    • 4 yrs ago
    • Reported - view

    This will not work in the Mac-enviroment.

    Birger

    • havrup
    • 2 yrs ago
    • Reported - view

    Is this still true? (Then it may explain my problem but if not why is there difference how a file is handled in openURL vs importFile)

    I have below code behind a button and it works for 50% af my files so I thought there was a limitation how the files can look like. (My file names has numbers , brackets, bar, spaces and letters in it)

    When I execute openURL(vFileToAttach) it always work. So what is the difference with openURL() and importFile()? when it comes to the filename?

     

    CODE:

    let vStart := "file:////Library/WebServer/Documents/";
    let vFileName := text('Å.File');
    let vFileToAttach := vStart + vFileName;
    importFile(this, vFileToAttach);

    • Ninox partner
    • RoSoft_Steven.1
    • 2 yrs ago
    • Reported - view

    Not sure if this would work (can't try it now):

    importFile(this, openURL(vFileToAttach));

    Steven

    • UweG
    • 2 yrs ago
    • Reported - view

    Try
    importFile(this, vFileToAttach,"Filename include type of file");

    Example Filename include type of file [Picture.jpg]

    • havrup
    • 2 yrs ago
    • Reported - view

    Thnaks for the suggestions. @Steven - if you try you will understand why it doen't work. openURL() opens the file immediatly and den I don't think "the code" can grab it - but it was a good idea!

     

    @Uwe - not sure I really understood how you ment and I tried tofin a way through the manual and tried different ways with "filename" or [filename]  etc - no luck.

     

    So I had to use the IBM method "Its Better Manulay" - took some time but it was a rainy day wher I live!

    I guess we still have Birgers word that it is npt working in the Mac environmnet.

    • UweG
    • 2 yrs ago
    • Reported - view

    Have you tried this?

    let vStart := "file:////Library/WebServer/Documents/";
    let vFileName := text('Å.File');
    let vFileToAttach := vStart + vFileName;
    importFile(this, vFileToAttach,vFileName[+".jpeg" or ".pdf" or ".png"]); -> depends how vFilename looks like.

Content aside

  • 2 yrs agoLast active
  • 6Replies
  • 1254Views