Jump to content

zilav

uniGUI Subscriber
  • Posts

    573
  • Joined

  • Last visited

  • Days Won

    44

Posts posted by zilav

  1. And can this task decided with TidFTPServer and TidFTP?

    Only if you run a single instance of UniGui app on the host machine (standalone or server). ISAPI won't work at all.

     

    If you still insist on using FTP, then install any free FTP server. From your VCL app generate unique name for a file to upload (probably some hash), send it to FTP server with TIdFTP, then http POST uploaded unique file name to UniGUI app as I've shown you.

  2. Zilav - thank you very much !!! I will post here my results anyway. And about clouds - i will test it too. Have a nice day there.

    Here is an example from my project where I generate thubmnails and upload them to S3 with public access for internet shop.

    function TFrameItems.UploadThumbnail(aStream: TStream; aName: string): Boolean;
    var
      s3: TAmazonS3;
    begin
      Result := False;
      s3 := TAmazonS3.Create(Self);
      try
        try
          s3.AccessKeyID := data.GetSetting('AWSAccessKeyId');
          s3.SecretAccessKeyID := data.GetSetting('AWSSecretKey');
          s3.AmzHeaders.Values['x-amz-acl'] := 'public-read';
          s3.AmzHeaders.Values['x-amz-storage-class'] := 'REDUCED_REDUNDANCY';
          s3.UploadObject(data.GetSetting('AWSBucketName'), aName, 'image/jpeg', aStream);
          Result := True;
        except
          // handle error here
        end;
      finally
        s3.Free;
      end;
    end;
    
    

    AmazonS3.zip

  3. SeverModule has event for custom HTTP requests, so you can POST a file as octet stream from VCL app to your UNI app.

     

    However I recommend to use cloud services like Amazon S3 for example. There are existing Delphi libs to manage cloud services and you'll get a working link when file is uploaded without cluttering your server.

  4. It's not so easy as you think, give it try and see....

    It is not about difficulty, but rather possibility. Client side validation is possible to remove especially on modern browsers with bulit-in dev tools and debuggers, that's enough for it to be insecure.

  5. Using client side is more efficient, faster and less code.

    But insecure for critical data, client side validations can be easily removed by anyone. I still recommend to validate on server too in addition to client side just in case.

  6. The only way is to actually force user to click the link, this is a security measure in browsers to prevent sites from launching associated apps themselves. the same way as browsers asking you what to do with downloaded file instead of launching associated apps on their own.

     

    If your mailto address depends on lets say the selected row in dbgrid, update UniLabel link in AfterScroll event.

  7. It is not strong, superior, bad or whatever. Just another combination of time proven software for web which is currently being replaced by other modern technologies like NoSQL databases, NodeJS. etc which can excel at different tasks where LAMP is not the right choice. The same as UniGUI being better at single page web applications.

    It is very popular though in web hosting and web development with a lot of complete solutions for majority of typical tasks you want from a web site. My own web development experience started back in early 2000's with LAMP.

    • Upvote 1
  8. It took only 15 posts in a thread before you mentioned that hardware is installed on a client machine(s) and not on another server. In that case what you want is impossible from within web application and unigui is not the right tool for your task. A traditional client-server application is required.

     

    ps. Unless you can configure all hardware on all your client machines to be connected to a single server which can issue commands.

×
×
  • Create New...