close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

When I update my file name is deleted

Thread began 4/20/2010 10:50 am by jegoadby285710 | Last modified 5/25/2012 6:49 am by Jason Byrnes | 8069 views | 47 replies |

jegoadby285710

When I update my file name is deleted

hi

The problem i have is when i use the update function the filename is deleted laving no link to the uploaded doc.

I have used this in the past with no real problems at all and I have looked hard at the code but can not see any obvious errors.

Iv attached the file in question.

Any help is most welcome

Employment_Profile_a.php

Kind regards

John

Sign in to reply to this post

arista341524

Having similar problem

I think I'm having a similar problem, although I might just be using the software incorrectly. My page is supposed to be updating a database record which feeds a photo file name to the database. The update function works fine, but you MUST re-upload a photo each time, or else it deletes the previous photo record. I know there's a solution here, but I can't find it.

Thanks...

Sign in to reply to this post

Jimmy Wu

arista341524: The default file field must not be set for you. If you are updating, you are getting the value of the original file name in a recordset. You will have to bind the original name (stored in the database) to the default file name.

jegoadby285710: does the value get erased every time or just when you don't upload a file?

Sign in to reply to this post

jegoadby285710

Originally Said By: Jimmy Wu
  arista341524: The default file field must not be set for you. If you are updating, you are getting the value of the original file name in a recordset. You will have to bind the original name (stored in the database) to the default file name.

jegoadby285710: does the value get erased every time or just when you don't upload a file?  



Hi

It only gets deleted when i dont upload a new file. Problem is I'm sure i'v set up the defalt file name field correctly i.e. bound it to ha hidden field with a value of the original file name from the data base i know this to be correct as iv tested the record to see if its retrieving the name.

Iv attached the php page

Any help is very welcome

Kind regards

John

Attached Files
Employment_Profile_a.php.zip
Sign in to reply to this post

jegoadby285710

Originally Said By: arista341524
  I think I'm having a similar problem, although I might just be using the software incorrectly. My page is supposed to be updating a database record which feeds a photo file name to the database. The update function works fine, but you MUST re-upload a photo each time, or else it deletes the previous photo record. I know there's a solution here, but I can't find it.

Thanks...  



Hi

There is a default file name you can set, unfortunately this is the problem I'm having at the moment. It allows you to maintain the original file name unless you decide to upload a new one and saves having to upload the same file evey time you update any other records.

Kind regards

John

Sign in to reply to this post

Jason ByrnesWebAssist

in the code, the default file field is linked to the textfield form element:

php:
'DefaultFileName' => "".((isset($_POST["textfield"]))?$_POST["textfield"]:"")  ."",





your hidden form elemeent that contains the origianl file name is not named textfield, it is named cvv:

php:
<input name="cvv" type="hidden" id="cvv" value="<?php echo $row_WAATKEmployment['Employment_CV_name']; ?>" />





change the default file code to:

php:
'DefaultFileName' => "".((isset($_POST["cvv"]))?$_POST["cvv"]:"")  ."",
Sign in to reply to this post

jegoadby285710

Still not working

Hi Jason

I have changed the code and its still not saving the name.

I really have gone though this with a magnifying glass but just can not see any obvious mistakes.

Thanks for looking.

Any suggestions most gratefully received.

Best

John

Sign in to reply to this post

Jason ByrnesWebAssist

ok, to trouble shoot, change:
$WA_redirectURL = "View_Profile.php";

to:
$WA_redirectURL = "";

so that the page will not redirect after the update

then add the following code in the body tag:

php:
<?php

if($_SERVER["REQUEST_METHOD"] == "POST"){
echo(
"SQL: "$WA_Sql."<br />");
echo(
"default file:".((isset($_POST["cvv"]))?$_POST["cvv"]:"")."<br />");
echo(
"Debug Info:<br />"WA_DFP_AllUploadsDebug());
}
?>




post the results of this code after testing and a new copy of our page.

Sign in to reply to this post

jegoadby285710

Results of test

SQL: UPDATE `Employment` SET `Employment_Full_Name` = 'John Goadby', `Employment_UserName` = 'johngoadby', `Employment_Password` = 'j12345', `Employment_Adres_Hous_No` = '37', `Employment_Adres_Street` = 'Barwell Road', `Employment_Adres_Town` = 'Suffolk', `Employment_Adres_County` = 'Suffolk', `Employment_Adres_Post_C_Zip` = 'IP33 1AF', `Employment_Country` = 'UK', `Employment_Eamil` = 'jegoadby@mac.com', `Employment_Mobile` = '07752830118', `Nokia` = 'N', `Ericsson` = 'N', `Alcatel` = 'Y', `BTS` = 'N', `Microwave` = 'N', `Employment_CV_name` = '' WHERE `Employment_pk`=11
default file:
Debug Info:
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

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
login.php

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...