Hello Friends,
I am new in using codeigniter.I am working on a client project.In this i have 1 form with fields like entering name, address along with 5 file uploading basically all images.Suppose while submitting a form an error occures then fields like name and address value can be retrieve from post values.but this didn’t happen for file uploading.And my client requires this.he said if an error occured then he has to upload all files again even if there are no errors related to file uploading.
So friends pls help me out.pls provide a way where i can retrieve all values for file uploading also…......... :'(

Recommended Answers

All 3 Replies

$_FILES where 'attachedfile' is the name of the form field. If the error is 0 then all went well. Look here for an explanation of the error code:
http://us3.php.net/manual/en/features.file-upload.errors.php

Also, this will give you some info regarding the files array:

echo '<pre>';
	print_r($_FILES);
	echo "</pre>";

$_FILES where 'attachedfile' is the name of the form field. If the error is 0 then all went well. Look here for an explanation of the error code:
http://us3.php.net/manual/en/features.file-upload.errors.php

Also, this will give you some info regarding the files array:

echo '<pre>';
	print_r($_FILES);
	echo "</pre>";

This is fine.But i want to retrieve the previously entered details for file uploading if form submission fails.

If u know then pls let me know.

Thanks 4 ur reply.

Ah, I see ... you want the file field to be populated with the original full local file path and name if the upload fails so that the user can simply click on the send button again?

Sorry, I don't even know if this is possible as I believe (but am not certain) that this information does not get sent to the server, just the file gets sent. I could so easily be wrong mind you.

Sorry I couldn't be more helpful,

Simon.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.