Is there a way to upload a file to the Gateway?? Part of our project involves displaying a picture of the part that is actually in production. I need to find an easy way to upload those files to the server for display.
Yes, I could use FTP, or map a drive to transfer the file to the server, but I am building a Management App as part of this system and it seems natural that they should be able to upload pictures too…
Since there doesn’t seem to be anything built it, I found some PHP code via the Google Machine (http://php.about.com/od/advancedphp/ss/php_file_upload.htm), uploaded, setup the IIS directory, found and fixed a PHP security permission issue (interactivetools.com/forum/f … um=2211143), and it works great as a stand alone web page from the users default browser.
Within my Managemet Screens, I was hoping to simply add a Document Viewer pointing to the simple html front end. It appears to work, as I can see the “Please choose a file: and the Browse and Upload buttons” but it fails. I get a generic “Sorry there was a problem uploading your file” This is what I was getting before I fixed the permissions issue linked above.
I wonder if Java is imparting some security restrictions on the PHP code? or maybe Java forces the code to use a different temp directory?
Anyone have any ideas? Yes I could simply redirect them with a web link to click on that would open in their browser, but I would rather keep the user within the Ignition application if possible.
You can also use a database and BLOB type to store and share uploaded file.
Use SQL script function to insert or select the data.
Whith this way it’s simple to share file beetween client and gateway.
You should know that Ignition Gatway IS a web server.
You can simply upload to the following directory (windows) :
C:\Program Files\Inductive Automation\Ignition\tomcat\webapps\main
Of course, you can add your directory, like \maintenance_docs…
and the acces it with the following :
gnguyen, Understood, however, the images will reside (and already do) in a different location, and I need to be able to upload via some sort of web interface. Yes, they could map a network drive, and upload the files there, but management has asked that they be able to upload the images by the web interface so that we don’t have to rely on drive mappings.
I have created a web uplaod via PHP, which by itself works as needed. Only problem is that when I add it to Ignition as a Document Viewer with the URL to the PHP web uplaod it doesn’t work.
I don’t think the Document Viewer component is going to work for this. It’s not a browser, it just happens to be able to display basic HTML, among other document formats, as well as be able to load a document via a URL and not just the file system.
You’ll probably need to use system.net.openUrl() to and make this open in the browser.
Yea, like Kevin “said”, you can get the file to open just fine, but if you need to upload files to the server, you’re going to have to get the IT administrators to give you permission to save files on the server (unless they are image files; i think inductive allows image files to be saved on the server).
You might try simply storing the string path to the network UNC and using system.net.openURL to get the file.