73
Views
3
Comments
[File FTP Plugin] Upload to FTP Example
Question
file-ftp-plugin
Mobile icon
Forge asset by JohnGB
Application Type
Mobile

Hi there,

I'm new in Outsystem ans I need guidance in using the File_UploadToFTP action.

Some of the parameters in the action I don't know what to fill with.

Local Device file to upload: /media/test.txt

FTP destination: ftp_ip/media/test.txt

What should I fill in the parameters MainFolderName, SubFolderName, Filename, RemoteFile, ScopeName?

Thank you for your help

2018-05-15 08-41-11
Davide Periquito

Hey 


If it helps this is the official description of the fields:

/**

 * Upload one local file to the ftp server.

 *

 * @param {string} localPath The file (with full path) you want to upload from the local device (e.g. "/path/to/localFile").

 * @param {string} remotePath The file (with full path) you want to create on the ftp server (e.g. "/path/to/remoteFile").

 *                            As you see, "localFile" can be renamed to "remoteFile".

 * @param {function} successCallback The success callback. It will be triggered many times according the file's size.

 *                                   The arg `0`, `0.11..`, `0.23..` ... `1` means the upload percent. When it reaches `1`, means finished.

 * @param {function} errorCallback The error callback.

 */
UserImage.jpg
José Azevedo

Hi Davide,

Thank you for your help. With the information you provided I was able to fill the fields correctly.

Now I have another problem. If you could help it would be awesome.

When I run the File_UploadToFTP action I get a blank page with the message:

There was an error processing your request. RELOAD

In the error logs i found this error:

So I went to the File_UploadToFTP action in the plugin, edited the javascript part and removed this part and only keep the FTP part of the javascript:

By doing this I was able to upload the file to the ftp server (that's how i know I filled the fields correctly) but the File_UploadToFTP action stopped after the upload and didn't returned the outputs. It was like the action stopped after the javascript and the next steps weren't taken.

The PluginManager is loaded From CommonPlugin:

I believe the problem is the Scope value passed to the File_UploadToFTP action.

I'm passing the name of the module that calls the action. Is that correct? Or what is supposed to be the scope?

Any help would be appreciated.

Thank you



UserImage.jpg
José Azevedo

After a little more digging a found that after removing the plugin manager and scope parts of the javascript I left a few scope instances in the code. After removing them the upload runned correctly and every steps after the upload also runned correctly.

My problem is resolved but I had to remove a part of the javascript in the File_UploadToFTP action. I don' know if that part of the code is important or not.

If it is I would appecciate if someone tell me how to resolve the issue.

Thank you

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.