برگزیده های پرشین تولز

نمایش پیشرفت آپ لود

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
سلام بروبچز!

یه اسکریپ می خوام که هنگام آپ لود یک فایل نشون بده چقدرش رفته. در واقع یک جور Progress bar با gif یا هر چیز دیگه که بوسیله PHP و Javascript کنترل بکنه که چقدر از فایل آپ لود شده. :blink:

منتظرم!!!! :hmm: :blush:

:D تشکر. :rolleyes:
 

Shahed

کاربر قدیمی پرشین تولز
تاریخ عضویت
30 ژوئن 2003
نوشته‌ها
7,270
لایک‌ها
34
محل سکونت
mt.cgi
آره ! اون قسمت پروگرس بارش بايد ري فرش بشه ! حالا يا يه فريم باشه يا يه چيزي تو مايه هاي آژاکس !
 

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
رفرش شدنش که درست ولی چه شکلی بفهمم که چقدر آپ لود شد؟ این مهمه.
 

Shahed

کاربر قدیمی پرشین تولز
تاریخ عضویت
30 ژوئن 2003
نوشته‌ها
7,270
لایک‌ها
34
محل سکونت
mt.cgi
به نقل از balabala :
رفرش شدنش که درست ولی چه شکلی بفهمم که چقدر آپ لود شد؟ این مهمه.
نميدونم !
162.gif

ولي به هر حال بايد حجم فايل رو قبل از آپلود داشته باشيم ! اينم که تا کامل آپلود نشده در نمياد !
164.gif
 

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
به نقل از Shahedr :
نميدونم !
162.gif

ولي به هر حال بايد حجم فايل رو قبل از آپلود داشته باشيم ! اينم که تا کامل آپلود نشده در نمياد !
164.gif
37.gif

بالاخره یه راهی هست. پس چه شکلی این سایتهای آپ لود پراگرس نشون میدن؟
 

hba

کاربر فعال صفحات داینامیک
کاربر فعال
تاریخ عضویت
8 آگوست 2004
نوشته‌ها
1,511
لایک‌ها
1
سن
39
محل سکونت
تهران-ونک-php-mysql
این رو به نام clicktrap.js ذخیره کن
PHP:
<!-- Please keep copyright lines in place without changes. 
// Copyright 2000 William and Mari Bontrager 
// Copyright 2003 Bontrager Connection, LLC 
// 
// For more information and instructions, please 
// see the "Double Click Trapper" article at 
// [url]http://willmaster.com/possibilities/archives[/url] 


// When the form's submit button is clicked a second 
// time, the click trap is set. Here, specify how 
// many seconds the trap exist before it's released. 

TrapClicksForHowManySeconds = 10; 



// If the user clicks the submit button and causes a 
// trap, or clicks when a trip is set, you may spawn 
// an alert box with a message. If you do want to 
// spawn the alert box, specify the message between 
// the quotation marks. Otherwise, leave it blank. 
//(Blank is two consecutive quotation mark characters, 
// with nothing between them.) 
// Note: If you use any quotation marks in the message 
// itself, those must be preceeded with a back-slash 
// character. Example: "My name is \"tall\", okay?" 

AlertBoxMessage = "One click is sufficient. The server should respond momentarily.\n\n\nClick the \"OK\" button."; 



// If the user clicks the submit button and causes a trap, 
// or clicks when a trip is set, you may spawn a popup 
// box. If you want to spawn the popup box, specify 
// the URL of the web page to insert into the popup. 
// Otherwise, leave it blank. You may also specify 
// the height of the popup and the width of the popup. 

PopUpBoxURL = ""; 
PopUpBoxHeight = 300; 
PopUpBoxWidth = 500; 



// If you want the submit button to change its text when 
// it is clicked, specify the name you assigned to the 
// form, the name you assigned to the submit button 
// form field, and the new text for the submit button. 
// Otherwise, leave at least one of these blank. 

NameOfForm = "upload"; 
NameOfSubmitButton = "uploadbutton"; 
NewTextForSubmitButton = "Sending File(s) . . ."; 



// ////////////////////////////////////////// // 
// NO CUSTOMIZATION REQUIRED BELOW THIS POINT // 
// ////////////////////////////////////////// // 


TrapTime = 0; 
DoubleClickTrapperCounter = 0; 


function DoubleClickTrapperAction() { 
DoubleClickTrapperCounter++; 
DoubleClickTrapperButton(); 
var trapTheClick = false; 
if(DoubleClickTrapperCounter > 1 ) { trapTheClick = true; } 
if(trapTheClick == true) { 
if(TrapTime == 0) { 
var tDate = new Date; 
TrapTime = tDate.valueOf(); 
} 
else { 
var tDate = new Date; 
var localTrapTime = tDate.valueOf(); 
if((localTrapTime - TrapTime) > (TrapClicksForHowManySeconds * 1000)) { 
TrapTime = 0; 
trapTheClick = false; 
DoubleClickTrapperCounter = 0; 
} 
} 
} 
var valueToReturn = true; 
if(trapTheClick == true) { 
valueToReturn = false; 
DoubleClickTrapperPopUp(); 
DoubleClickTrapperAlert(); 
} 
return valueToReturn; 
} // end of function DoubleClickTrapperAction() 


function DoubleClickTrapperButton() { 
var formname = StripSpaces(NameOfForm); 
var submitname = StripSpaces(NameOfSubmitButton); 
var newtext = StripSpaces(NewTextForSubmitButton); 
if(formname.length > 0 && submitname.length > 0 && newtext.length > 0) { 
var s = 'document.' + NameOfForm + '.' + NameOfSubmitButton + ".value = '" + NewTextForSubmitButton + "'"; 
eval(s); 
} 
} // end of function DoubleClickTrapperButton() 


function DoubleClickTrapperPopUp() { 
var url = StripSpaces(PopUpBoxURL); 
if(url.length > 0) { 
if(PopUpBoxHeight < 1) { PopUpBoxHeight = 200; } 
if(PopUpBoxWidth < 1) { PopUpBoxWidth = 300; } 
window.open(url,'',('height=' + PopUpBoxHeight + ',width=' + PopUpBoxWidth + ',resizable=yes,scrollbars=yes')); 
} 
} // end of function DoubleClickTrapperPopUp() 


function DoubleClickTrapperAlert() { 
var message = StripSpaces(AlertBoxMessage); 
if(message.length > 0) { alert(AlertBoxMessage); } 
} // end of function DoubleClickTrapperAlert() 


function StripSpaces(s) { 
while(s.indexOf(' ') == 0) { s = s.substr(1); } 
return s; 
} // end of function StripSpaces() 

// -->

کار این جاوا اسکریپت اینه دیگه راه انداختنش با خودت سخت نیست ارسال باید بش بدی
 

Shahed

کاربر قدیمی پرشین تولز
تاریخ عضویت
30 ژوئن 2003
نوشته‌ها
7,270
لایک‌ها
34
محل سکونت
mt.cgi
اين چيکار ميکنه؟
73.gif
 

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر
به نقل از hba :
این رو به نام clicktrap.js ذخیره کن
...
کار این جاوا اسکریپت اینه دیگه راه انداختنش با خودت سخت نیست ارسال باید بش بدی
ممنون ولی اون چیزی که من میخوام رو انجام نمیده. یعنی پیشرفت آپ لود رو نشون نمیده بلکه از دوبار فرستادن یک submit جلو گیری می کنه و بجاش یک میسج نشون میده که فایل داره آپ لود میشه. http://willmaster.com/possibilities/demo/DoubleClickTrapper/
 

hba

کاربر فعال صفحات داینامیک
کاربر فعال
تاریخ عضویت
8 آگوست 2004
نوشته‌ها
1,511
لایک‌ها
1
سن
39
محل سکونت
تهران-ونک-php-mysql
درسته روند کار رو نشون نمی ده ولی می گه به درستی در حال اپلود هست و داره ادامه پیدا می کنه
 

balabala

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
22 می 2005
نوشته‌ها
8,362
لایک‌ها
5,745
سن
41
محل سکونت
یه خورده اونورتر

carp3

کاربر تازه وارد
تاریخ عضویت
15 آپریل 2005
نوشته‌ها
1,318
لایک‌ها
1
سن
94
بالا