473,657 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to upload image from 1 server to other.

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
Feb 4 '08 #1
5 1106
maybe create a web service on the server with web method...someth ing
like this?:
[WebMethod(Descr iption = "Check Image Upload")]
public bool CheckImageUploa d(byte[] byteImage,
out string ErrorInfo)
{

ImageUpload iu = new ImageUpload();

.....
.....
....

if (!iu.SaveImageT oFile(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 ImageFileFullPa th = <path to
image>;

System.IO.Memor yStream ms =
new System.IO.Memor yStream(byteIma ge);

System.Drawing. Bitmap bitmap =

(System.Drawing .Bitmap)System. Drawing.Image.F romStream(ms);

bitmap.Save(Ima geFileFullPath,
System.Drawing. Imaging.ImageFo rmat.Png);

ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.M essage;
return false;
}
}

....
....
Feb 4 '08 #2
On 4 Lut, 16:44, siccolo <aleks...@hotma il.comwrote:
maybe create a web service on the server with web method...someth ing
like this?:
[WebMethod(Descr iption = "Check Image Upload")]
public bool CheckImageUploa d(byte[] byteImage,
out string ErrorInfo)
{

ImageUpload iu = new ImageUpload();

....
....
...

if (!iu.SaveImageT oFile(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 ImageFileFullPa th = <path to
image>;

System.IO.Memor yStream ms =
new System.IO.Memor yStream(byteIma ge);

System.Drawing. Bitmap bitmap =

(System.Drawing .Bitmap)System. Drawing.Image.F romStream(ms);

bitmap.Save(Ima geFileFullPath,
System.Drawing. Imaging.ImageFo rmat.Png);

ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.M essage;
return false;
}
}

...
...
oh, thats a good idee :)
Feb 4 '08 #3
On 4 Lut, 16:44, siccolo <aleks...@hotma il.comwrote:
maybe create a web service on the server with web method...someth ing
like this?:
[WebMethod(Descr iption = "Check Image Upload")]
public bool CheckImageUploa d(byte[] byteImage,
out string ErrorInfo)
{

ImageUpload iu = new ImageUpload();

....
....
...

if (!iu.SaveImageT oFile(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 ImageFileFullPa th = <path to
image>;

System.IO.Memor yStream ms =
new System.IO.Memor yStream(byteIma ge);

System.Drawing. Bitmap bitmap =

(System.Drawing .Bitmap)System. Drawing.Image.F romStream(ms);

bitmap.Save(Ima geFileFullPath,
System.Drawing. Imaging.ImageFo rmat.Png);

ErrorInfo = "";
return true;
}
catch (Exception ex_save_image)
{
ErrorInfo = ex_save_image.M essage;
return false;
}
}

...
...
btw, what is faster? web service or file transfare [ftp] ?
Feb 4 '08 #4
On Feb 4, 4:43*pm, "lazi...@gmail. com" <lazi...@gmail. comwrote:
On 4 Lut, 16:44,siccolo<a leks...@hotmail .comwrote:


maybe create a web service on the server with web method...someth ing
like this?:
[WebMethod(Descr iption = "Check Image Upload")]
* * public bool CheckImageUploa d(byte[] byteImage,
* * * * * * * * * * * * * * * * out string ErrorInfo)
* * {
* * * * ImageUpload iu = new ImageUpload();
....
....
...
* * * * * * if (!iu.SaveImageT oFile(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 ImageFileFullPa th = <path to
image>;
* * * * * * System.IO.Memor yStream ms =
* * * * * * * * * * new System.IO.Memor yStream(byteIma ge);
* * * * * * System.Drawing. Bitmap bitmap =
(System.Drawing .Bitmap)System. Drawing.Image.F romStream(ms);
* * * * * * bitmap.Save(Ima geFileFullPath,
System.Drawing. Imaging.ImageFo rmat.Png);
* * * * * * ErrorInfo = "";
* * * * * * return true;
* * * * }
* * * * catch (Exception ex_save_image)
* * * * {
* * * * * * ErrorInfo = ex_save_image.M essage;
* * * * * * 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:)
Feb 5 '08 #5
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
Feb 6 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11753
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 table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
15
5333
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 path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
0
4749
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 verdiği hata şu.Bilen arkadaşlar lütfen yardım edin Persits.Upload.1 error '800a0020' The system cannot find the path specified. /classifieds/upload.asp, line 250
9
3824
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 site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
4
9072
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 file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a project where client javascript requests an image server to generate dynamic images. The client...
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8606
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6169
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.