attachments addon

Hi there.

Does anyone have a problem with the addon?

i upload a pdf file and when i press create nothing happens.

the file does not upload.

You have to upload twice to get it to add the attachment





Chris

i tried it…

Nothing happens.

is there a solution for this?

i need it!

Does everyone just accept having to upload an attachment twice? I feels like a bug to me. Why do we have to upload attachments twice?

Very likely var/attachments directory does not have write permit

I find that when I click a FILE to edit it, it many times takes me to the attachments page rather than the file page. The 'Cancel' link doesn't work in the picker-pop-up. Clicking the X to close exits the picker and a subsequent click of the FILE link will take me to the editor for the FILE. Probably the same issue as the double-click above. I reported this years ago and was told they couldn't re-create, but happens to me in every version since 2.0 every day. So I just live with it.

My issue is rather simple and it happens every time.



When I add a new attachment, I upload the file and click create. When I go back into the attachment the “attached” file is there with zero bytes upload. I them simply click “local” again and upload the file again. It always works the second time. Never the first time.



Same behavior for every attachment.



I take that other people do not have the same issue?

yep, same problem here… seems crazy. actually its not the first time I have had an issue uploading a file even. I have had occasions when creating image banners that the image doesn't upload…

also, if it uploads the second time, then I doubt it is a permissions problem on the var/attachments folder…

[quote][color=#282828][font=arial, verdana, tahoma, sans-serif]but happens to me in every version since 2.0 every day. So I just live with it.[/font][/color][/quote] That would have to suck! ;-)

If you guys do the fix that is at the bottom of http://forum.cs-cart.com/tracker/issue-3583-attachments-images-upload-with-0-bytes/page__gopid__13864#entry13864 you'll be all set.



Thanks,



Brandon

I created a support ticket and was able to resolve this issue. I take no credit for this fix it was all thanks to CS-Cart's awesome support team!


[quote]

It seems that the problem occurs because PHP on your server fails to overwrite a temporary file (with zero size) with an uploaded one for some reason. Please replace the following part of code:


$tempfile = fn_create_temp_file();
if (move_uploaded_file($val['path'], $tempfile) == true) {




with this one:



$tempfile = fn_create_temp_file();
unlink($tempfile);
if (move_uploaded_file($val['path'], $tempfile) == true) {




in the fn.fs.php file located in the core directory of your CS-Cart installation. After that please re-upload the attachments and let me know the result.

[/quote]

Good day,
I've been trying to test out installing a custom addon (by uploading a .zip file) onto the platform, however my attemps have been met with the error text "Error Incorrect add-on structure. The uploaded pack cannot be installed.", The addon was created using the guidlines from "Hello World Add-on Tutorial" and the code snippet is exactly the same. So I do not understand why it keeps saying the structure is incorrect. I've also tried using the code from the "Example of the Addon.xml File (Scheme 3.0)" also to no avail. The only file in the zipped folder hello_world is the addon.xml file.
Thanks in advance