Hi,
I have 2 hostings one is in USA and the second is in the my country.
So, is there any way to do uploading users pictures from the 1st
server to secound without using FTP? Maybe upload control can do this?
bye 5 1098
maybe create a web service on the server with web method...something
like this?:
[WebMethod(Description = "Check Image Upload")]
public bool CheckImageUpload(byte[] byteImage,
out string ErrorInfo)
{
ImageUpload iu = new ImageUpload();
.....
.....
....
if (!iu.SaveImageToFile(byteImage, out ErrorInfo))
{
return false;
}
ErrorInfo = "";
return true;
}
catch (Exception ex)
{
ErrorInfo = ex.Message;
return true;
}
}
....
....
public bool SaveImageToFile(byte [] byteImage,
out string ErrorInfo)
{
try
{
string ImageFileFullPath = <path to
image>;
System.IO.MemoryStream ms =
new System.IO.MemoryStream(byteImage);
System.Drawing.Bitmap bitmap =
(System.Drawing.Bitmap)System.Drawing.Image.FromSt ream(ms);
bitmap.Save(ImageFileFullPath,
System.Drawing.Imaging.ImageFormat.Png);
ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.Message;
return false;
}
}
....
....
On 4 Lut, 16:44, siccolo <aleks...@hotmail.comwrote:
maybe create a web service on the server with web method...something
like this?:
[WebMethod(Description = "Check Image Upload")]
public bool CheckImageUpload(byte[] byteImage,
out string ErrorInfo)
{
ImageUpload iu = new ImageUpload();
....
....
...
if (!iu.SaveImageToFile(byteImage, out ErrorInfo))
{
return false;
}
ErrorInfo = "";
return true;
}
catch (Exception ex)
{
ErrorInfo = ex.Message;
return true;
}
}
...
...
public bool SaveImageToFile(byte [] byteImage,
out string ErrorInfo)
{
try
{
string ImageFileFullPath = <path to
image>;
System.IO.MemoryStream ms =
new System.IO.MemoryStream(byteImage);
System.Drawing.Bitmap bitmap =
(System.Drawing.Bitmap)System.Drawing.Image.FromSt ream(ms);
bitmap.Save(ImageFileFullPath,
System.Drawing.Imaging.ImageFormat.Png);
ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.Message;
return false;
}
}
...
...
oh, thats a good idee :)
On 4 Lut, 16:44, siccolo <aleks...@hotmail.comwrote:
maybe create a web service on the server with web method...something
like this?:
[WebMethod(Description = "Check Image Upload")]
public bool CheckImageUpload(byte[] byteImage,
out string ErrorInfo)
{
ImageUpload iu = new ImageUpload();
....
....
...
if (!iu.SaveImageToFile(byteImage, out ErrorInfo))
{
return false;
}
ErrorInfo = "";
return true;
}
catch (Exception ex)
{
ErrorInfo = ex.Message;
return true;
}
}
...
...
public bool SaveImageToFile(byte [] byteImage,
out string ErrorInfo)
{
try
{
string ImageFileFullPath = <path to
image>;
System.IO.MemoryStream ms =
new System.IO.MemoryStream(byteImage);
System.Drawing.Bitmap bitmap =
(System.Drawing.Bitmap)System.Drawing.Image.FromSt ream(ms);
bitmap.Save(ImageFileFullPath,
System.Drawing.Imaging.ImageFormat.Png);
ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.Message;
return false;
}
}
...
...
btw, what is faster? web service or file transfare [ftp] ?
On Feb 4, 4:43*pm, "lazi...@gmail.com" <lazi...@gmail.comwrote:
On 4 Lut, 16:44,siccolo<aleks...@hotmail.comwrote:
maybe create a web service on the server with web method...something
like this?:
[WebMethod(Description = "Check Image Upload")]
* * public bool CheckImageUpload(byte[] byteImage,
* * * * * * * * * * * * * * * * out string ErrorInfo)
* * {
* * * * ImageUpload iu = new ImageUpload();
....
....
...
* * * * * * if (!iu.SaveImageToFile(byteImage, out ErrorInfo))
* * * * * * {
* * * * * * * * return false;
* * * * * * }
* * * * * * ErrorInfo = "";
* * * * * * return true;
* * * * }
* * * * catch (Exception ex)
* * * * {
* * * * * * ErrorInfo = ex.Message;
* * * * * *return true;
* * * * }
* * }
...
...
public bool SaveImageToFile(byte [] byteImage,
* * * * * * * * * * * * * * * * out string ErrorInfo)
* * {
* * * * try
* * * * {
* * * * * * string ImageFileFullPath = <path to
image>;
* * * * * * System.IO.MemoryStream ms =
* * * * * * * * * * new System.IO.MemoryStream(byteImage);
* * * * * * System.Drawing.Bitmap bitmap =
(System.Drawing.Bitmap)System.Drawing.Image.FromSt ream(ms);
* * * * * * bitmap.Save(ImageFileFullPath,
System.Drawing.Imaging.ImageFormat.Png);
* * * * * * ErrorInfo = "";
* * * * * * return true;
* * * * }
* * * * catch (Exception ex_save_image)
* * * * {
* * * * * * ErrorInfo = ex_save_image.Message;
* * * * * * return false;
* * * * }
* * }
...
...
btw, what is faster? web service or file transfare [ftp] ?- Hide quoted text -
- Show quoted text -
SOAP/HTTP versus FTP? in general FTP is faster...but...FTP is more
efficient for large(er) files, and HTTP is for smaller...but FTP and
HTTP based on the same TCP/IP...but, it all depends on the bandwith,
servers, application etc etc..my 3cents:)
SOAP/HTTP versus FTP? in general FTP is faster...but...FTP is more
efficient for large(er) files, and HTTP is for smaller...but FTP and
HTTP based on the same TCP/IP...but, it all depends on the bandwith,
servers, application etc etc..my 3cents:)
ok :) thx for answare
bye This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dave |
last post by:
Hello there,
I am at my wit's end ! I have used the following script succesfully to
upload an image to my web space. But what I really want to be able to do is
to update an existing record in a...
|
by: David Lozzi |
last post by:
Howdy,
I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders!
Now I am making a public function that will take the...
|
by: SEMIH DEMIR |
last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim
yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa
persistin upload componentini kullanacam yanlız suanki haliyle...
|
by: Wayne Smith |
last post by:
I've come up against a major headache that I can't seem to find a solution
for but I'm sure there must be a workaround and I would really be grateful
of any help.
I'm currently building a web...
|
by: SammyBar |
last post by:
Hi all,
I wonder is it possible to upload the content of an <imgfield to a server.
The content of the <imgwas downloaded from a web site different from the
one it should be uploaded. The image...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |