View Full Version : Automatic upload.
chipprell
01-29-2012, 12:33 AM
Hello,
is there any way how can I automatically upload images to pimpandhost, by any script, external app, or anything else?
Automatically how? Give me example.
chipprell
02-18-2012, 02:26 AM
Sorry for late response.
Well i have C# aplication what works with images. I need to upload images to pimp and host and get url for original image size, something like:
http://www.pimpandhost.com/image/14226799-original.html
I can get that url thats not problem with search, but i dont know how to upload images with C#, im not familiar with this flashuploader :{
Any hints?
korifeich
02-21-2012, 04:08 AM
Here are my own function
public static string UploadImage(string imageLink, string imageSize)
{
string Link = "";
string command = "";
Post_Get login1 = new Post_Get("http://www.pimpandhost.com/upload/postUrl?req=%7B%22hash%22%3A%227582909469429%22%2C %22vall%22%3A%22" + imageLink + "%22%2C%22albumId%22%3A-1%7D");
try
{
Link = @login1.postGet();
}
catch (WebException ex)
{
return "bad";
}
StringBuilder sb = new StringBuilder(Link);
sb.Replace("\\/", "/");
Link = sb.ToString();
string pattern = @"http://www.pimpandhost.[a-z|/]+([0-9|a-z]+)";
Match Match = Regex.Match(Link, pattern);
Link = Match.Groups[1].ToString();
command = "http://www.pimpandhost.com/image/" + Link + "-original.html";
try
{
login1 = new Post_Get(command);
Link = @login1.postGet();
}
catch(WebException ex)
{
return "bad";
}
switch (imageSize)
{
case "original": pattern = "<input.+bb_codes_original.+.* ( + command + )"; break;
case "thumb": pattern = "<input.+bb_codes_thumb.+.* ( + command + )"; break;
case "small": pattern = "<input.+bb_codes_small.+.* ( + command + )"; break;
case "medium": pattern = "<input.+bb_codes_medium.+.* ( + command + )"; break;
}
Match = Regex.Match(Link, pattern);
Link = Match.ToString();
if (imageSize == "small" || imageSize == "thumb")
{
pattern = "http://.*jpg";
Match = Regex.Match(Link, pattern);
if (Match.ToString() == "")
{
pattern = "http://.*png";
Match = Regex.Match(Link, pattern);
}
Link = Match.ToString();
return "";
}
else
{
pattern = "http://i.*jpg";
Match = Regex.Match(Link, pattern);
if (Match.ToString() == "")
{
pattern = "http://i.*png";
Match = Regex.Match(Link, pattern);
}
Link = Match.ToString();
return "" + Link + "";
}
}
Post_GEt is just modified get request
But this is Remote upload by the link.
chipprell
02-29-2012, 01:36 AM
Thx, i will look at it later, gtg work now.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.