cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Show all Files of a Folder

drieder
16-Pearl

Show all Files of a Folder

Hello everyone,

 

for our Project I would like to access the Files in a folder associated with the device (e.g Documentation). 

 

For another Project I was already able to display a pdf-File on a button Click. On Click the following code is executed:

 

$scope.showDoku = function(){
var anchor = document.createElement('a');
anchor.href = 'app/resources/Uploaded/wagoController.pdf';
window.location.href = anchor.href;
};

 

Now I would like to (if possible) "automatically" generate a List (of Buttons?) based on the content of lets say
'app/resources/Uploaded/DeviceX/'. The List should display the filenames contained in the folder DeviceX. And if possible a "clickable" List. I would simply extend the the code above by adding a parameter with the filename then.

 

The reason behind this is, that files regarding a Device may be added/deleted and the Buttons/Listelements should be consistent with the foldercontent. The reason for the Project is to avoid all this "file handling" regarding a device. It would be very nice to just "scan" the Code of a device an have all relevant files in one place instead of searching for them.

 

Any help with this issue is appreciated very much.

 

Thank you in advance!

 

Best Regards,

Dominik

ACCEPTED SOLUTION

Accepted Solutions

I was able to solve this by simly using a list-widget and managing the filenames in an infotable.

The list-widget offers an "on-element-click" event, with which you can call the function I described earlier.

View solution in original post

4 REPLIES 4

Hi @drieder ,

 

there is a related post /not the same/ "Check if Image exist".  There the input is a list of files and the code will check if all files could be found. May be this approach could be helpful if you have already a list(json file) containing all files in a particular folder (e.g. the Upload folder). I think on server side is possible to start some unix /or windows tool to create

such list for a folder (with subfolder) or such list could be maintained manually 

there is a related post /not the same/ "Check if Image exist".  There the input is a list of files and the code will check if all files could be found. May be this approach could be helpful if you have already a list(json file) containing all files in a particular folder (e.g. the Upload folder)

such list for a folder (with subfolder) or such list could be maintained manually 

Possibly, you can also check on server side (listen ) if the project upload folder changed. E.g. the posts:  "Watch a folder for changes using node.js, and print file paths when they are changed" and  "How to Watch for Files Changes in Node.js"

So means that this will change the project and will add e.g. to Upload folder a current list of all files. This list will be also downloaded with the project when the project scanned and downloaded. (make no sense for offline AR projects)

Hello @RolandRaytchev ,

 

Thank you for your Reply. I'm going to try out your suggested approach and let you know how it worked out.

 

Best Regards,

Dominik

I was able to solve this by simly using a list-widget and managing the filenames in an infotable.

The list-widget offers an "on-element-click" event, with which you can call the function I described earlier.

Announcements

Top Tags