Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:09:57+00:00 2026-06-08T13:09:57+00:00

my question is as tittle.I have a datasnap rest server,I want upload file with

  • 0

my question is as tittle.I have a datasnap rest server,I want upload file with java or java script.How do? (best have sample code)
thank your very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:09:59+00:00Added an answer on June 8, 2026 at 1:09 pm

    I’ve once tried to pass a stream to a REST call, but eventually
    resorted to uploading with a direct WebBroker request to a page…
    which is easier to manage. That’s not trivial either, as you’ll have to manage the multi-part request data that you receive when you use a form to let the user pick the file to upload.

    This is some of the code I’m using in WebModuleBeforeDispatch:

    type TMyIdHTTPAppRequest = class (TIdHTTPAppRequest);

        haReq := TMyIdHTTPAppRequest(Request);
        fname := IntToStr (haReq.ContentLength);
        multi := TMultipartRequestFiles.Create(haReq.FRequestInfo,
          haReq.content);
    
        if (multi.Count > 0) and Assigned (multi.Items[0]) then
        begin
         theFile := TFileStream.Create(ServerConf['fileupload:tempdir'] + folder + '\' +
            multi.Items[0].FileName, fmCreate);
          multi.Items[0].Stream.Position := 0;
          TheFile.CopyFrom(multi.Items[0].Stream, multi.Items[0].Stream.Size);
          theFile.Free;
    

    However it is based on a custom TMultipartRequestFiles that I have, trying to clean it up and load it as part of my Relax open source extension to Delphi datasnap.

    Any other solution to manage file uploads? I guess there should be something ready to use in Indy, I wrote that class many years ago.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I want is basically in the question title. I have a website page,
Alternate question title would be: How to explicitly have the compiler generate code for
As I have mentioned in question title, I am trying below code to reach
Excuse the terrible question title. I have this PHP string and want to check
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have
OK the question title is vague, but here's the problem. I have a list
Sorry about the wording for my question title. I have a basic HTML anchor
Question in title pretty much sums it up. I have some resource object defined
As per the title I have three parts to this question... Is db4o object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.