close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Unable to Update or Insert Images

Thread begun 9/06/2009 1:01 pm by Daryl | Last modified 9/09/2009 9:42 am by Daryl | 7516 views | 16 replies |

DarylBeta Tester

Unable to Update Images

I have an Insert and Update page which I have tried to intergrate DFP to upload a logo.

I have been through the Video Tutorials and have also printed off the pdfs and have followed them through a couple of times but still can't get them to work.

Data is being inserted into the Database correctly, with the exception of the logo column.

I have attached them here for anyone to have a look at for me.

Thanks in advance

Attached Files
Unit_Insert.zip
Unit_Update.zip
Sign in to reply to this post

DarylBeta Tester

OK, I have had a look at code on another Insert page that I created some time ago that works...

It seems that it was the DFP form that I was getting wrong.....

In the original page I had;

php:
<?php

WA_DFP_SetupUploadStatusStruct
("WA_UploadResult1");
if(isset(
$_POST["Insert_x"])){
    
WA_DFP_UploadFiles("WA_UploadResult1""".((isset($_POST["unit_logo"]))?$_POST["unit_logo"]:"")  ."""2""[NewFileName]_[Increment]""PNG:5"$WA_UploadResult1_Params);
}
?>



But I should have had this;

php:
<?php

WA_DFP_SetupUploadStatusStruct
("WA_UploadResult1");
if(isset(
$_POST["Insert_x"])){
    
WA_DFP_UploadFiles("WA_UploadResult1""unit_logo""2""[NewFileName]_[Increment]""PNG:5"$WA_UploadResult1_Params);
}
?>



The images upload, but the only problem now is that I am getting these errors:

  Warning: unlink(/home/sites/lsdogs.org.uk/public_html/Members/../images/unit_logos/3ddc849e072b9aec8473e02b496c76a3.png) [function.unlink]: No such file or directory in /home/sites/lsdogs.org.uk/public_html/WA_DigitalFilePro/HelperPHP.php on line 212  



  Warning: Cannot modify header information - headers already sent by (output started at /home/sites/lsdogs.org.uk/public_html/WA_DigitalFilePro/HelperPHP.php:212) in /home/sites/lsdogs.org.uk/public_html/Members/Unit_Insert.php on line 94  
Sign in to reply to this post

DarylBeta Tester

I have tried running the DFP2 Beta but get the same results.

I have ensured that all folder are CHMOD 777 and have confirmed that the images are getting to the right folder....

Sign in to reply to this post

anonymous

Daryl,

Just so I understand (in order to help better), is the file name making it into the database column?

Or, is the image being uploaded to your folder but the database not storing the name?

Or is neither happening?

Best regards,

Brian

Sign in to reply to this post

DarylBeta Tester

Hi Brian

Now that I have changed the code on my page to replicate another that I made, the file is now uploaded and the file name is now uploaded to the page, however I get the two errors mentioned on my last post.

I have attached the latest code in case this helps.

Attached Files
Unit_Insert(2).zip
Sign in to reply to this post

DarylBeta Tester

Some additional info about the Update Page.

The Debug report says;

  Status object: WA_UploadResult1
statusCode : 0
errorMessage : No file uploaded
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1
statusCode : 0
errorMessage : No file uploaded  



I also have the following error script running which does not display any errors;

php:
<?php 

error_reporting
(E_ALL); 
ini_set('display_errors','on'); 
?>



The latest edition of this file is attached

Attached Files
Unit_Update(2).zip
Sign in to reply to this post

DarylBeta Tester

Could this have anything to do with my SQL?

Originally it had a few SQL statements that I didn't recognise that kept throwing up errors. Things like the word param before user_id and things like that.

When I have been trying to get this working I tried going into the SQL to test things but it wouldn't let me do anything as it didn't recognise these statements.

So now they arn't there.....

Sign in to reply to this post

anonymous

Daryl,

9 times out of 10, anytime you see that headers error, it is because of "white space" before or between php tags BEFORE the output of your page's html.

In other words if you had this, it would cause an error (notice the space between the php tags:

php:
<?php


a bunch of code here 
and there

?>

<?php some more code ?>



Make sure all your pre-html PHP looks like this:

php:
<?php


a bunch of code here 
and there

?>
<?php some more code ?>



Make sure there are no lines... you could even bring the start of the next PHP tag right after the close of the last one. This is where I would start first making sure there are no possible spaces between PHP tags or the beginning of the file... if it still gives the headers error, then we know to look elsewhere.

Best regards,

Brian

Sign in to reply to this post

DarylBeta Tester

Thanks again Brian...

I have ensured that every PHP tag (both opening and closing) is touching the the previous or following tag in both the Insert and Update pages.

The insert page inserts alll of the text properly and also uploads the images and adds the file name to the database, but I get

  Warning: unlink(/home/sites/lsdogs.org.uk/public_html/images/unit_logos/802ea42c0bfcb804566d11edd96a9c62.png) [function.unlink]: No such file or directory in /home/sites/lsdogs.org.uk/public_html/WA_DigitalFilePro/HelperPHP.php on line 212  



And with the Update page no file is uploaded and no file name is put into the database. The error codes that I get are;

  Status object: WA_UploadResult1
statusCode : 0
errorMessage : No file uploaded
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1
statusCode : 0
errorMessage : No file uploaded  



On another note - It would be useful to have a pdf somewhere that explains the last set of error codes that I have uploaded (and all the others with that script) and a quick faq on things to try to resolve it.

Sign in to reply to this post

DarylBeta Tester

The Insert now works!!!

It appears that my host does not allow 777 CHMOD due to security reasons, however the folder says that it is 777.

After changing it to 755 (the hosts suggestion) the Insert worked!!!!!

Its just the Update now.....

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...