Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
jad  
#1 Posted : Tuesday, March 28, 2006 9:50:34 PM(UTC)
jad

Rank: Member

Groups: Member
Joined: 3/28/2006(UTC)
Posts: 4

I'm seeing an odd problem with the error handling in ImageUploader.

I've added this JS function to my page to aid in debugging:
Code:
function ImageUploader_Progress( Status , Progress , ValueMax , Value , StatusText ) {
  if( Status == "COMPLETE" ) {
     document.clear();
     document.write(StatusText);
     document.close();
  }
  if( Status == "ERROR" ) {
    alert( "status is ERROR, Value is " + Value + "  StatusText is " + StatusText );
  }
}


When I try and upload files to the remote php script, I get the classic 'waiting for retry' box appear, followed by 'ImageUploader encountered some problems...'.

At that point, the alert box from ImageUploader_Progress is displayed, showing:
'status is ERROR, Value is 4 StatusText is'

According to the documentation, when Value is set to 4, StatusText should be set to the server response, but it appears to be empty.

Also, watching the network traffic, I can see the server sending the following back to the client:

Code:
HTTP/1.1 302 Found
Date: Wed, 29 Mar 2006 13:30:38 GMT
Server: Apache/2.0.54 (Unix) PHP/4.4.2
X-Powered-By: PHP/4.4.2
Location: http://dev.xxxxxx.com/rr_2
Content-Length: 0
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8


Shouldn't this mean that Value should actually be set to 11, with StatusText set to the new URL?

Anyone got any ideas what is going on here?

Edited by user Monday, February 18, 2008 2:04:55 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Thursday, March 30, 2006 4:33:01 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Could you post the link to your site for us to test the page?
Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
jad  
#3 Posted : Thursday, March 30, 2006 5:15:49 PM(UTC)
jad

Rank: Member

Groups: Member
Joined: 3/28/2006(UTC)
Posts: 4

Sorry, but the site is running on an internal development server at the moment, which is not reachable from outside.
If it's of any help at all, the site is running Drupal, which I'm trying to integrate ImageUploader into.
Alex Makhov  
#4 Posted : Thursday, March 30, 2006 6:22:01 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

So,

Could you post your page code?
Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
jad  
#5 Posted : Friday, March 31, 2006 12:44:10 AM(UTC)
jad

Rank: Member

Groups: Member
Joined: 3/28/2006(UTC)
Posts: 4

Here you go.
Apologies for the extreme unpleasantness of the code; this appears to be a trait of Drupal...; I've marked the ImageUploader bit with a few *'s:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <title>Submit images | oursite</title>
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://dev.oursite.com/" />
<style type="text/css" media="all">@import "misc/drupal.css";</style><style type="text/css">@import url(sites/oursite.com/modules/ecommerce/cart/cart.css);</style>
<script type="text/javascript" src="sites/oursite.com/modules/menu_otf/menu_otf.js"></script><style type="text/css">@import url(sites/oursite.com/modules/menu_otf/menu_otf.css);</style>

<SCRIPT TYPE="text/javascript" SRC="/iuembed.js"></SCRIPT>
  <style type="text/css" media="all">@import "sites/oursite.com/themes/oursite/style.css";</style>  <script type="text/javascript"> </script>
</head>
<body ><div class="bw1"><div class="bw2"><div id="body-wrap">

<div id="header">
  <div class="hw1"><div class="hw2">
    <h1 id="site-name" class="without-slogan"><a href="" title="Oursite Title Thingy"><img src="sites/oursite.com/files/oursite_logo.jpg" alt="oursite Logo" id="site-logo" /></a></h1>
  </div></div>
</div>

<div id="content" class="content-left"><div class="cw1"><div class="cw2"><div class="cw3"><div class="cw4"><div class="cw5"><div class="cw6"><div class="cw7"><div class="cw8">
 <div id="content-wrap" class="content-wrap-left">
      <div class="sidebar" id="sidebar-left">
      <div class="block block-user" id="block-user-1">
  <h2 class="first">site_admin</h2>
  <div class="content"><div class="menu">
<ul>
<li class="leaf"><a href="blog/viewmine"><span class="lw1">View my site</span></a></li>
<li class="leaf"><a href="blog/links"><span class="lw1">My links</span></a></li>
<li class="leaf"><a href="gallery"><span class="lw1">My photo galleries</span></a></li>
<li class="collapsed"><a href="blog/settings"><span class="lw1">My site&#039;s settings</span></a></li>
<li class="leaf"><a href="product"><span class="lw1">buy your membership</span></a></li>
<li class="leaf"><a href="march_sub"><span class="lw1">buy your membership</span></a></li>
<li class="leaf"><a href="devel/cache/clear"><span class="lw1">empty cache</span></a></li>
<li class="leaf"><a href="devel/variable"><span class="lw1">variable viewer</span></a></li>
<li class="expanded"><a href="node/add"><span class="lw1">create content</span></a>
<ul>
<li class="leaf"><a href="node/add/images" class="active"><span class="lw1">Images</span></a></li>
<li class="leaf"><a href="node/add/flexinode-1"><span class="lw1">News</span></a></li>
<li class="leaf"><a href="node/add/image"><span class="lw1">image</span></a></li>
<li class="leaf"><a href="node/add/image_import"><span class="lw1">import images</span></a></li>
<li class="leaf"><a href="node/add/page"><span class="lw1">page</span></a></li>
<li class="leaf"><a href="node/add/product"><span class="lw1">product</span></a></li>

</ul>
</li>
<li class="leaf"><a href="tracker"><span class="lw1">recent posts</span></a></li>
<li class="collapsed"><a href="user/site_admin"><span class="lw1">My account</span></a></li>
<li class="collapsed"><a href="admin"><span class="lw1">administer</span></a></li>
<li class="leaf"><a href="logout"><span class="lw1">Sign out</span></a></li>

</ul>
</div></div>
</div>
    </div>
      
  <div id="main" class="main-left"><div id="main-wrap" class="main-wrap-left"><div class="mw1">
    
    
    <div class="breadcrumb"><a href="">Home</a> &raquo; <a href="node/add"><span class="lw1">create content</span></a></div>
          <h2 class="main-title">Submit images</h2>
    
           
            
    <!-- begin content --><form action="/node/add/images" method="post" enctype="multipart/form-data" name="image_form" id="node-form">
<div class="node-form"><input type="hidden" name="op" value="Preview" />
<div class="admin"><div class="authored"><fieldset><legend>Authoring information</legend><div class="form-item">
 <label for="edit-name">Authored by:</label>

 <input type="text" maxlength="60" class="form-text" name="edit[name]" id="edit-name" size="20" value="site_admin" />
</div>
<div class="form-item">
 <label for="edit-date">Authored on:</label><span class="form-required">*</span>

 <input type="text" maxlength="25" class="form-text required" name="edit[date]" id="edit-date" size="20" value="2006-03-31 16:36:32 +0000" />
</div>
</fieldset>
</div>
<div class="options"><fieldset><legend>Options</legend><input type="hidden" name="edit[status]" value="0" />
<div class="form-item">
 <label class="option"><input type="checkbox" class="form-checkbox" name="edit[status]" id="edit-status" value="1" checked="checked" /> Published</label>
</div>
<input type="hidden" name="edit[moderate]" value="0" />
<div class="form-item">
 <label class="option"><input type="checkbox" class="form-checkbox" name="edit[moderate]" id="edit-moderate" value="1" /> In moderation queue</label>
</div>
<input type="hidden" name="edit[promote]" value="0" />
<div class="form-item">
 <label class="option"><input type="checkbox" class="form-checkbox" name="edit[promote]" id="edit-promote" value="1" checked="checked" /> Promoted to front page</label>
</div>
<input type="hidden" name="edit[sticky]" value="0" />
<div class="form-item">
 <label class="option"><input type="checkbox" class="form-checkbox" name="edit[sticky]" id="edit-sticky" value="1" /> Sticky at top of lists</label>
</div>
<input type="hidden" name="edit[revision]" value="0" />
<div class="form-item">
 <label class="option"><input type="checkbox" class="form-checkbox" name="edit[revision]" id="edit-revision" value="1" /> Create new revision</label>
</div>
</fieldset>
</div>
<div class="extra"><fieldset><legend>User comments</legend><div class="form-item">
 <label class="option"><input type="radio" class="form-radio" name="edit[comment]" value="0" /> Disabled</label>
<label class="option"><input type="radio" class="form-radio" name="edit[comment]" value="1" /> Read only</label>
<label class="option"><input type="radio" class="form-radio" name="edit[comment]" value="2" checked="checked" /> Read/write</label>

</div>
</fieldset>
</div></div><br clear="all" /><div class="standard"><div class="form-item">
 <label for="edit-title">Title:</label><span class="form-required">*</span>

 <input type="text" maxlength="128" class="form-text required" name="edit[title]" id="edit-title" size="60" value="" />
</div>
<div class="form-item">
 <label for="edit-path">Path alias:</label>

 <input type="text" maxlength="250" class="form-text" name="edit[path]" id="edit-path" size="60" value="" />
 <div class="description">Optionally specify an alternative URL by which this node can be accessed.  For example, type "about" when writing an about page.  Use a relative path and don't add a trailing slash or the URL alias won't work.</div>
</div>
An alias will be automatically generated from the title and other node attributes, in addition to any alias manually provided above. To control the format of the generated aliases, see the <a href="admin/settings/pathauto">pathauto settings</a>.<div class="form-item">
 <label for="edit-gallery_id">Gallery:</label>

 <select name="edit[gallery_id]" id="edit-gallery_id"><option value="1" selected="selected">pic of the week</option><option value="3">Another gallery</option><option value="5">tuesday</option><option value="6">wednesday</option></select>
</div>
*************************
*************************
*************************
<script language="javascript">
function ImageUploader_Progress( Status , Progress , ValueMax , Value , StatusText ) {
  if( Status == "COMPLETE" ) {
     document.clear();
     document.write(StatusText);
     document.close();
  } 
  if( Status == "ERROR" ) {
    alert( "status is ERROR, Value is " + Value + "  StatusText is " + StatusText );
  } 
}
var iu = new ImageUploaderWriter("ImageUploader", 770, 500);
iu.activeXControlEnabled = true;
iu.javaAppletEnabled = true;

//For ActiveX control we specify full path for CAB file
iu.activeXControlCodeBase = "/websites/dev.oursite.com/ImageUploader3.cab";
iu.activeXControlVersion = "3,5,180,0";

//For Java applet we specify only directory with JAR files
iu.javaAppletCodeBase = "/";
iu.javaAppletCached = true;
iu.javaAppletVersion = "1.1.60.0";

iu.addParam("Layout","ThreePanes");
iu.addParam("UploadThumbnail1FitMode","Fit");
iu.addParam("UploadThumbnail1Width","120");
iu.addParam("UploadThumbnail1Height","120");
iu.addParam("UploadThumbnail1JpegQuality","60");
iu.addParam("ShowDebugWindow","true");
iu.addParam("AdditionalFormName","image_form");
iu.addParam("EnableRotate","true");
iu.addParam("Action","node/add/images" );
//iu.addEventListener("Progress", "ImageUploader_Progress");

iu.writeHtml();
</script><fieldset id="quick-menu" class="collapsed"><legend>Menu navigation</legend><div class="form-item">
 <label for="edit-menu][title">Menu item title:</label>

 <input type="text" maxlength="128" class="form-text" name="edit[menu][title]" id="edit-menu][title" size="60" value="" onclick="setTitle(this.form);return false;" />
 <div class="description">The name to display for this link.</div>
</div>
<div class="form-item">
 <label for="edit-menu][pid">Parent item:</label>

 <select name="edit[menu][pid]" id="edit-menu][pid"><option value="1"> Navigation</option><option value="584">-- My photo galleries</option><option value="600">-- buy your membership</option><option value="599">-- buy your membership</option><option value="581">-- compose tips (disabled)</option><option value="592">-- content (disabled)</option><option value="593">---- create content (disabled)</option><option value="582">------ News</option><option value="586">------ image</option><option value="641">------ import images</option><option value="594">------ page</option><option value="598">------ product</option><option value="578">-- empty cache</option><option value="587">-- image galleries (disabled)</option><option value="639">-- image galleries (disabled)</option><option value="640">-- image galleries processing (disabled)</option><option value="603">-- search (disabled)</option><option value="601">-- user list (disabled)</option><option value="579">-- variable viewer</option><option value="633">-- recent posts</option><option value="615">-- administer</option><option value="636">---- access control</option><option value="576">---- blocks</option><option value="631">---- categories</option><option value="577">---- comments</option><option value="591">---- content</option><option value="583">------ content types</option><option value="588">---- image galleries</option><option value="580">---- input formats</option><option value="638">---- logs</option><option value="608">------ referrers</option><option value="606">------ top pages</option><option value="607">------ top users</option><option value="605">------ recent hits</option><option value="590">---- menus</option><option value="630">---- modules</option><option value="617">---- settings</option><option value="618">------ address</option><option value="619">------ devel</option><option value="620">------ flexinode</option><option value="621">------ image</option><option value="642">------ image_import</option><option value="622">------ img_assist</option><option value="589">------ legal</option><option value="623">------ menu_otf</option><option value="624">------ pathauto</option><option value="625">------ payment</option><option value="626">------ paypal</option><option value="602">------ profiles</option><option value="604">------ search</option><option value="627">------ statistics</option><option value="628">------ store</option><option value="632">------ tinymce</option><option value="634">------ uploads</option><option value="629">------ worldpay</option><option value="609">---- store</option><option value="596">------ payment options</option><option value="597">-------- configure adjustments</option><option value="611">------ search</option><option value="613">------ subscriptions</option><option value="614">-------- subscriptions notification test</option><option value="610">------ transactions</option><option value="612">-------- create transaction</option><option value="616">---- themes</option><option value="595">---- url aliases</option><option value="635">---- users</option><option value="585">---- help</option><option value="637">-- Sign out</option></select>
</div>
</fieldset>
<input type="hidden" name="edit[menu][description]" value="" />
<input type="hidden" name="edit[menu][path]" value="" />
<input type="hidden" name="edit[menu][weight]" value="0" />
<input type="hidden" name="edit[menu][mid]" value="0" />
<input type="hidden" name="edit[menu][type]" value="86" />
<div class="attachments"><fieldset><legend>Attachments</legend><div class="form-item">
 <label for="edit-upload">Attach new file:</label>

 <input type="file" class="form-file" name="edit[upload]" id="edit-upload" size="40" />

</div>
<input type="submit" class="form-submit" name="fileop" value="Attach"  />
<div class="description">Changes made to the attachments are not permanent until you save this post.  The first "listed" file will be included in RSS feeds.</div></fieldset>
</div><input type="hidden" name="edit[uid]" value="1" />
<input type="hidden" name="edit[created]" value="1143822992" />
<input type="hidden" name="edit[type]" value="images" />
<input type="submit" class="form-submit" name="op" value="Preview"  />
<input type="submit" class="form-submit" name="op" value="Submit"  />
</div></div>
</form>
<!-- end content --> 
      </div></div>
 </div>
</div>
     
 <span class="clear"></span>
</div></div></div></div></div></div></div></div></div>

</div></div></div>
<div id="footer-links">
  <a href="http://www.oursite.com/">Home Page</a> | <a href="http://www.oursite.com/tc">Terms & Conditions</a> | <a href="http://www.oursite.com/contact">Contact Us</a>
</div>
</body>
</html>


Many thanks for your help on this

Edited by user Thursday, December 20, 2007 4:57:42 PM(UTC)  | Reason: Not specified

jad  
#6 Posted : Tuesday, April 04, 2006 10:57:21 PM(UTC)
jad

Rank: Member

Groups: Member
Joined: 3/28/2006(UTC)
Posts: 4

Anyone got any ideas at all about this one???
Alex Makhov  
#7 Posted : Wednesday, April 05, 2006 1:01:24 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Well, your code looks good.
The reason of the problem could be in the server settings. For example if there is some limitation of max upload data amount. In this case server closes the connection and upload fails. Check your web application configuration.

One more note on your code. Clearing and writing to the current document is not the best way to show the upload result. The better way is to redirect to some successful result page.

Edited by user Monday, February 18, 2008 2:06:07 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.