Click here to Skip to main content
15,902,634 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Compare tables Pin
sumit703417-Jul-08 2:25
sumit703417-Jul-08 2:25 
Questionhow to stop the user not to edit any thing in the page . Pin
lakshmichawala17-Jul-08 0:57
lakshmichawala17-Jul-08 0:57 
AnswerRe: how to stop the user not to edit any thing in the page . Pin
eyeseetee17-Jul-08 1:06
eyeseetee17-Jul-08 1:06 
Questionasp:table [modified] Pin
raushan_917-Jul-08 0:26
raushan_917-Jul-08 0:26 
AnswerRe: asp:table Pin
Imran Khan Pathan17-Jul-08 2:20
Imran Khan Pathan17-Jul-08 2:20 
QuestionCreating a dynamic field in sql server 2005 database tables using c# Pin
harish.k1217-Jul-08 0:20
harish.k1217-Jul-08 0:20 
QuestionTreeView reordering nodes Pin
c#ivan16-Jul-08 23:59
c#ivan16-Jul-08 23:59 
Questionconvert php script to javascript Pin
Guvera16-Jul-08 23:33
Guvera16-Jul-08 23:33 
Smile | :) Hi friends,

I am familiar in Asp.net. I have a php script code for flash uploading. I need to convert this php script to java script. For ur's reference i put the code below,

include("JSON.php");
$result = array();

if (isset($_FILES['photoupload']) )
{
$file = $_FILES['photoupload']['tmp_name'];
$error = false;
$size = false;

if (!is_uploaded_file($file) || ($_FILES['photoupload']['size'] > 2 * 1024 * 1024) )
{
$error = 'Please upload only files smaller than 2Mb!';
}
elseif (!$error && !($size = @getimagesize($file) ) )
{
$error = 'Please upload only images, no other files are supported.';
}
elseif (!$error && !in_array($size[2], array(1, 2, 3, 7, 8) ) )
{
$error = 'Please upload only images of type JPEG.';
}
elseif (!$error && ($size[0] < 25) || ($size[1] < 25))
{
$error = 'Please upload an image bigger than 25px.';
}
else {
move_uploaded_file($_FILES['photoupload']['tmp_name'], "./uploadedfiles/".$_FILES['photoupload']['name']);
chmod("./uploadedfiles/".$_FILES['photoupload']['name'], 0777);
}

$addr = gethostbyaddr($_SERVER['REMOTE_ADDR']);

$log = fopen('script.log', 'a');
fputs($log, ($error ? 'FAILED' : 'SUCCESS') . ' - ' . preg_replace('/^[^.]+/', '***', $addr) . ": {$_FILES['photoupload']['name']} - {$_FILES['photoupload']['size']} byte\n" );
fclose($log);

if ($error)
{
$result['result'] = 'failed';
$result['error'] = $error;
}
else
{
$result['result'] = 'success';
$result['size'] = "Uploaded an image ({$size['mime']}) with {$size[0]}px/{$size[1]}px.";
}

}
else
{
$result['result'] = 'error';
$result['error'] = 'Missing file or internal error!';
}

if (!headers_sent() )
{
header('Content-type: application/json');
}

echo json_encode($result);

?>

In the above code a temporary file created and the uploaded files are stored in that folder.I need to convert this code in javascript.

I hope ur's reply

Thanks

Every Successful Person Have A Painful Story

AnswerRe: convert php script to javascript Pin
eyeseetee16-Jul-08 23:49
eyeseetee16-Jul-08 23:49 
QuestionOpening a new popup window on click of a hyperlink from another popup window in ASP. Pin
Rajiya16-Jul-08 23:29
Rajiya16-Jul-08 23:29 
AnswerRe: Opening a new popup window on click of a hyperlink from another popup window in ASP. Pin
varshavmane17-Jul-08 0:13
varshavmane17-Jul-08 0:13 
QuestionAuto Complete Search Pin
M. K. BASHER16-Jul-08 22:55
M. K. BASHER16-Jul-08 22:55 
AnswerRe: Auto Complete Search Pin
Imran Khan Pathan16-Jul-08 23:08
Imran Khan Pathan16-Jul-08 23:08 
AnswerRe: Auto Complete Search Pin
eyeseetee16-Jul-08 23:12
eyeseetee16-Jul-08 23:12 
Question[Message Deleted] Pin
M. K. BASHER16-Jul-08 22:47
M. K. BASHER16-Jul-08 22:47 
AnswerRe: Auto Complete Search Pin
eyeseetee16-Jul-08 22:51
eyeseetee16-Jul-08 22:51 
GeneralRe: Auto Complete Search Pin
M. K. BASHER16-Jul-08 23:06
M. K. BASHER16-Jul-08 23:06 
Questionhit counter Pin
eyeseetee16-Jul-08 22:38
eyeseetee16-Jul-08 22:38 
AnswerRe: hit counter Pin
Herman<T>.Instance17-Jul-08 3:30
Herman<T>.Instance17-Jul-08 3:30 
QuestionOnCacheitemRemoved event called in many many times Pin
Feras Mazen Taleb16-Jul-08 22:24
Feras Mazen Taleb16-Jul-08 22:24 
QuestionHow to setup Configuration For Folder Pin
Feras Mazen Taleb16-Jul-08 22:17
Feras Mazen Taleb16-Jul-08 22:17 
QuestionReportViewer Export to Excel Numbers Formatted as Text Pin
Member 438223216-Jul-08 22:08
Member 438223216-Jul-08 22:08 
AnswerRe: ReportViewer Export to Excel Numbers Formatted as Text Pin
IsmirHarambasic8-Oct-12 3:58
IsmirHarambasic8-Oct-12 3:58 
Questionembed code Pin
nithydurai16-Jul-08 21:55
nithydurai16-Jul-08 21:55 
Questionasp.net Pin
cst_kvp16-Jul-08 21:40
cst_kvp16-Jul-08 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.