자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다.
- 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)
Delphi [질문] 이미지를 datasnap을 사용하여 서버로 전송밥법
2021.08.08 17:15
본 게시판은 개발자들이 자유롭게 질문과 답변을 공유하는 게시판입니다.
* 따라서 최대한 정중하게 질문을 올려 주세요.
* 질문을 상세히 작성해 주실 수록 좋은 답변이 올라 옵니다.
* 다른 분들도 참고할 수 있도록 결과 댓글 필수(또는 감사 댓글)
(결과 댓글을 달지 않는 경우 다음 질문에 대한 답변이 달리지 않는 불이익이 있을 수 있습니다.)
-----------------------------------------------------------------------------------------------
XE10.4를 사용하여 이미지컴퍼넌트로 작성한 이미지를
서버로 전송하는 방법에 어떤 무제가 있을까요?
프로그램은
모바일에서 image1에 싸인 받아서 MSSQL서버로 저장하려하는 겁니다
모바일에서 image1에 싸인을 받는것은 성공했는데 이것을 datasnap을 이용헤서 서버로 전송하는
부분에 에러가 납니다
1) 저장화면의 이미지를 넘기는 방업이 잘못된건지?
2) data모듈쪽에서 서버로 넘기는 부분의 이미지control이 잘못된건지 모르겠습니다.
--------- 저장화면----------------------
procedure TForm2.Button3Click(Sender: TObject);
var
ImgStream : TMemoryStream;
begin
try
ImgStream := TMemoryStream.Create;
Image1.Bitmap.SaveToStream(ImgStream);
ImgStream.Position := 0;
if SQLConnection1.connected = false then
SQLConnection1.connected:=true;
Method := TServerMethods1Client.Create(SqlConnection1.DBXConnection);
Method.RVArea( 0,0, ImgStream);
Method.Free;
SQLConnection1.connected:=false;
Finally
ImgStream.free;
End;
end;
-------- data모듈 ---------
procedure TServerMethods1Client.RVArea( i1: Integer; i2: Integer; img: TMemoryStream);
begin
if FDataQueryAreaCommand = nil then
begin
FDataQueryAreaCommand := FDBXConnection.CreateCommand;
FDataQueryAreaCommand.CommandType := TDBXCommandTypes.DSServerMethod;
FDataQueryAreaCommand.Text := 'TServerMethods1.RVArea';
FDataQueryAreaCommand.Prepare;
end;
FDataQueryAreaCommand.Parameters[0].Value.SetInt32(i1);
FDataQueryAreaCommand.Parameters[1].Value.SetInt32(i1);
FDataQueryAreaCommand.Parameters[2].Value.SetStream(img, FInstanceOwner);
FDataQueryAreaCommand.ExecuteUpdate; <--- 요기 실행할때 "Remote error:Invalid class typecast"
에러가 나면서 서버쪽으로 못넘깁니다
end;
-------- 서버쪽 -------------
procedure TServerMethods1.RVArea( i1: Integer; i2: Integer; img: TMemoryStream);
begin
exit; -- 여기까지도 오지 않습니다
FDQuery2.close;
FDQuery2.sql.clear;
FDQuery2.SQL.Add(' insert into ....... ');
FDQuery2.ParamByName('psign').LoadFromStream(img, ftBlob );
end;
번호 제목 글쓴이 날짜 조회 수
공지
[프로그래밍 강의] 2021.6~2021.12
관리자 2015.01.22 19713
공지
유용한 관련 사이트
관리자2 2014.03.20 58650
공지
본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다.
관리자 2012.01.10 102193
13
FastReport 관련 문의
[1] 쿤이 2021.07.12 312
12
[질문] SMS 문자보내기 창으로 이동하는 방법
[1] 화현 2021.07.18 1467
11
개발툴 업그레이드 XE2 를 XE7 이나 XE8로
[1] 가나다 2021.07.20 308
10
cxGrid의 OnCustomDrawIndicatorCell 이벤트 문의드립니다.
[2] 딤몽 2021.07.26 484
9
MacOS 빌드 Error
[1] Sangin 2021.08.03 374
»
[질문] 이미지를 datasnap을 사용하여 서버로 전송밥법
[2] 화현 2021.08.08 1312
7
ios
[1] 지구수비방위대 2021.08.09 358
6
델파이(안드로이드) , cubrid 연결 문의.
[3] Hoony 2021.08.09 1321
5
Multi-Device Application 질문입니다.
[2] UK'S 2021.08.12 973
4
(팁) TRESTRequest Post방식 파일업로드와 함께 텍스트 변수 전송 10.4에서만 성공
미스터몽키 2021.08.18 6988
3
자동차 인식 방법에 대한 질문입니다.
[4] 거북선생 2021.08.25 2162
2
델파이 10.4 patch하니 실행이 안됩니다.
[7] 갈굼정미 2021.08.26 2102
1
JSON 파라메타 한글 문제
[2] 케이피 2021.08.26 2286
Delphi [질문] 이미지를 datasnap을 사용하여 서버로 전송밥법
2021.08.08 17:15
본 게시판은 개발자들이 자유롭게 질문과 답변을 공유하는 게시판입니다.
* 따라서 최대한 정중하게 질문을 올려 주세요.
* 질문을 상세히 작성해 주실 수록 좋은 답변이 올라 옵니다.
* 다른 분들도 참고할 수 있도록 결과 댓글 필수(또는 감사 댓글)
(결과 댓글을 달지 않는 경우 다음 질문에 대한 답변이 달리지 않는 불이익이 있을 수 있습니다.)
-----------------------------------------------------------------------------------------------
XE10.4를 사용하여 이미지컴퍼넌트로 작성한 이미지를
서버로 전송하는 방법에 어떤 무제가 있을까요?
프로그램은
모바일에서 image1에 싸인 받아서 MSSQL서버로 저장하려하는 겁니다
모바일에서 image1에 싸인을 받는것은 성공했는데 이것을 datasnap을 이용헤서 서버로 전송하는
부분에 에러가 납니다
1) 저장화면의 이미지를 넘기는 방업이 잘못된건지?
2) data모듈쪽에서 서버로 넘기는 부분의 이미지control이 잘못된건지 모르겠습니다.
--------- 저장화면----------------------
procedure TForm2.Button3Click(Sender: TObject);
var
ImgStream : TMemoryStream;
begin
try
ImgStream := TMemoryStream.Create;
Image1.Bitmap.SaveToStream(ImgStream);
ImgStream.Position := 0;
if SQLConnection1.connected = false then
SQLConnection1.connected:=true;
Method := TServerMethods1Client.Create(SqlConnection1.DBXConnection);
Method.RVArea( 0,0, ImgStream);
Method.Free;
SQLConnection1.connected:=false;
Finally
ImgStream.free;
End;
end;
에러가 나면서 서버쪽으로 못넘깁니다
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | [프로그래밍 강의] 2021.6~2021.12 | 관리자 | 2015.01.22 | 19713 |
공지 | 유용한 관련 사이트 | 관리자2 | 2014.03.20 | 58650 |
공지 | 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. | 관리자 | 2012.01.10 | 102193 |
13 | FastReport 관련 문의 [1] | 쿤이 | 2021.07.12 | 312 |
12 | [질문] SMS 문자보내기 창으로 이동하는 방법 [1] | 화현 | 2021.07.18 | 1467 |
11 | 개발툴 업그레이드 XE2 를 XE7 이나 XE8로 [1] | 가나다 | 2021.07.20 | 308 |
10 | cxGrid의 OnCustomDrawIndicatorCell 이벤트 문의드립니다. [2] | 딤몽 | 2021.07.26 | 484 |
9 | MacOS 빌드 Error [1] | Sangin | 2021.08.03 | 374 |
» | [질문] 이미지를 datasnap을 사용하여 서버로 전송밥법 [2] | 화현 | 2021.08.08 | 1312 |
7 | ios [1] | 지구수비방위대 | 2021.08.09 | 358 |
6 | 델파이(안드로이드) , cubrid 연결 문의. [3] | Hoony | 2021.08.09 | 1321 |
5 | Multi-Device Application 질문입니다. [2] | UK'S | 2021.08.12 | 973 |
4 | (팁) TRESTRequest Post방식 파일업로드와 함께 텍스트 변수 전송 10.4에서만 성공 | 미스터몽키 | 2021.08.18 | 6988 |
3 | 자동차 인식 방법에 대한 질문입니다. [4] | 거북선생 | 2021.08.25 | 2162 |
2 | 델파이 10.4 patch하니 실행이 안됩니다. [7] | 갈굼정미 | 2021.08.26 | 2102 |
1 | JSON 파라메타 한글 문제 [2] | 케이피 | 2021.08.26 | 2286 |
procedure TServerMethods1.RVArea( i1: Integer; i2: Integer; img: TMemoryStream);
위의 부분을 아래와 같이 바꾸시면 될 겁니다.
procedure TServerMethods1.RVArea( i1: Integer; i2: Integer; img: TStream);
datasnap 서버에서 TStream 을 TMemoryStream 으로 바꾸는 방법은 다음과 같습니다.
var
LMS: TMemoryStream;
begin
LMS := TMemoryStream.Create;
LMS.LoadFromStream(AStream);
end;
도움이 되시길...