Announcement

Collapse
No announcement yet.

Show selected Images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Show selected Images

    Hi,

    I need a little help with this project:

    I am trying to develop a Image FTP utility and I have all the functionality sorted however I am stuck showing the selected image files on the upload page. I browse and multiple select the images I want but I would like them to be shown on a page before upload button is selected.

    Any thoughts would be highly appreciated!

  • #2
    You could use Image objects and use them as placeholders, you can use the ThumbList object, or even create a HTML page dynamically with the "img src" pointing to the selected files and load it in a Web object... and these are just a few options.

    Ulrich

    Comment


    • #3
      Hi Ulrich,

      Thanks for the advice I have been messing around and I have solved that issue only to sit with this one:

      I can now list the images in Thumblist but I am wanting to FTP them which it does but does not send the complete file (meaning the server is showing 1.jpg) but with no data. I have posted my code if someone would mind taking a look.


      File_Count = ThumbList.GetItemCount("Plugin1");
      Files = ThumbList.AddFiles("Plugin1", File_Count);
      if (Files ~= -1) then

      FTP.Connect(host, username, password, "", true);
      err = Application.GetLastError();
      if err ~= FTP.OK then
      Dialog.Message("Error", _tblErrorMessages[err]);
      end


      folder_path = System.GetDate(DATE_FMT_ISO);
      FTP.ChangeDir("/Incoming");
      FTP.ChangeDir(folder_path);
      err = Application.GetLastError();
      if err ~= FTP.OK then
      FTP.MakeDir(System.GetDate(DATE_FMT_ISO));
      err = Application.GetLastError();
      if err ~= FTP.OK then
      Dialog.Message("Error", _tblErrorMessages[err]);
      Application.ExitScript();
      else
      FTP.ChangeDir(System.GetDate(DATE_FMT_ISO));
      err = Application.GetLastError();
      if err ~= FTP.OK then
      Dialog.Message("Error", _tblErrorMessages[err]);
      Application.ExitScript();

      end
      end
      end

      StatusDlg.SetMeterRange(0, File_Count);
      StatusDlg.Show(MB_ICONINFORMATION, false);

      StatusDlg.SetTitle("FTP Upload Status...");
      StatusDlg.SetMessage("FTP Upload in progress...");

      StatusDlg.ShowCancelButton(true, "Cancel");
      cancelled = StatusDlg.IsCancelled();

      for n=1,File_Count do
      StatusDlg.SetMeterPos(n);
      StatusDlg.SetStatusText(n.." of "..File_Count);

      FTP.Upload(Files, n..".jpg", nil);
      StatusDlg.SetMeterPos(n);

      end
      StatusDlg.Hide();
      FTP.ClearLog();
      FTP.Disconnect();
      ThumbList.Clear("Plugin1", -1);

      end

      Comment


      • #4
        The syntax for FTP upload action is
        Code:
        FTP.Upload (string Source, string Destination, function CallbackFunction)
        If you check your code, you will see that you are passing a table ("Files") instead of a path to the single file to be transferred in each iteration.

        Ulrich

        Comment


        • #5
          Sorted:

          Thank You, Dankie and Hamba kahle

          Comment

          Working...
          X