The selected file could not be copied, because no file by that name exists.

t4him - March 27, 2007 - 22:07
Project:Upload Image
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Get this message after installing the module on Drupal 5.

The scenario: Install module, activate, add file to post, edit post . . . error as below:
The selected file  could not be copied, because no file by that name exists. Please check that you supplied the correct filename

also, when you look at the path to the image, it is missing the file name. as below . . .
This file can be found at http://drupal5/files/.

So, have I messed something up, or is this a bug?

#1

drewish - March 28, 2007 - 17:05

it might be a bug with the image module. you should make sure you can create image nodes without using the upload_image module.

#2

t4him - March 28, 2007 - 17:30

Thanks drewish,

I am working with a fresh install of D.5.1 from 03/28/07. A fresh install of image and upload as well. If I disable the upload module it works fine. If I disable it, I get the error.

Can i give you any more info that might help here.

#3

davidsnyder@me.com - March 31, 2007 - 23:33

this is a known issue with image module. if you check the image module issue section you will see a patch, though it doesn't fully fix it.

#4

t4him - April 1, 2007 - 12:00

Thanks slidenby,

I have performed the patch AND downloaded the latest version of image module. Both seem to continue to produce the same results. The image filename is simply getting lost. I am currently looking at a way to abandon the image module. It simply is not stable and it should be. The image module for 4.7.x seemed to stay in a more stable state, but as more and more additions are made for 5.x, it seems there is a learning curve here for module development.

I was just trying to write up a new "recipe" to manage images and produce a slideshow with predictable results. My current thinking is using imagecache and views to produce the slides. If you set views to display as a "list" and only one image per page, it works. My current problem now is that imagecache deals with the images in a slightly different way when resizing., Anyway, that was way off subject.

Thanks for the response, I will continue to monitor this section for solutions that produce a stable image module. Until it is stable, I cannot use it.

#5

davidsnyder@me.com - April 1, 2007 - 19:43

I'm glad to hear you're thinking about getting away from the image module - the image module has so much potential, but just never seems to manage to live up to it. Though I'm pretty well stuck in with the image module now, having had been using for months and patching all along the way. It now works as I need it to, and with the addition of your module I've more or less built my whole site around the two (a image forum site).

I look forward to seeing what you come up with in the future. It is nice to see module developers coming up with alternative image solutions.

#6

drewish - April 1, 2007 - 23:42

t4him, sorry your not happy with the image module but i haven't seen you posting bug reports in its issue queue. i got added as a maintainer a few weeks back and i've committed a ton of bug fixes and closed over 100 bug and support requests. it may not be the right tool for you but it's gotten a lot more stable recently.

#7

t4him - April 2, 2007 - 15:41

drewish,
Thanks for the , have you tried a "fresh" install and then performed an import? I am not a module developer. The recipe I was speaking of was in reference to "another" way to create what I need for this project. The problem is with Drupal 5.x / image module and import image. I get the error, and apperently other are too. I did look through the issues that have been posted, this is why I did not issue a bug, It had already been issued. At the bottom of that bug, it was closed and said that the patch had been committed to head. I still have the problem.

I am not trying to create a rift, just trying to get a job done. If I have to wait, I have to wait. I am patient because I am not a programmer and rely on others to get it right. I guess my contribution is to report back when I have an issue. I was just wanting to know if there was a "solid" fix in place yet? So, is this considered fixed?

#8

verlierer - April 16, 2007 - 22:40
Title:The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename» I'm getting this error too...

the same error, except it comes up when uploading audio. (audio module)

"The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename."

The funny thing is that the uploaded audio is present and playable even though something triggered the error message. ??

#9

Christefano - December 4, 2007 - 23:56
Title:I'm getting this error too...» The selected file could not be copied, because no file by that name exists.

Please do not change the title and make it less descriptive. Comments in project issue queues work differently than comments in the forum.

#10

brahms - December 12, 2007 - 01:24

I'm sorry, but I think the problem is a bug in the Upload Image module and not in the Image module. I use following modules:

  • upload (from drupal core)
  • image (using the default image path "images")
  • upload image
  • upload preview

Download method is set to public and I am also using the default file system path "files".

I create a new node and attach an image "abc.jpg" to it using the core upload module. When I push the submit button, first the attached image is saved as "files/abc.jpg" by the upload module and an entry is written to the files table. In this entry the filepath column has the value "files/abc.jpg". After that Drupal calls the upload_image_nodeapi of the upload image module. Here the function "upload_image_save" is called and this creates a new image node and the original image "files/abc.jpg" gets saved as "files/images/abc.jpg". The original image "files/abc.jpg" gets lost but the entry for it in the "files" table still shows the filepath "files/abc.jpg" instead of "files/images/abc.jpg"! This is the reason, why you see the error saying "The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename". I think the "upload image" module should update the entry in the files table setting the filepath to the right path inside the image path of the image module. (You can try setting this with SQL and the error message is gone).

If you add following code in file upload_image.module (revision 1.17.2.6), between lines 198 and 199 in function upload_image_save, the entries in files table get the right filepath:

db_query("UPDATE {files} set filepath='%s' WHERE fid=%d", $image->images['_original'], $file->fid);

Here is the code from line 198 to line 200, line 199 is the bugfix:

db_query("INSERT INTO {upload_images} (nid, fid, oid) VALUES (%d, %d, %d)", $image->nid, $file->fid, $node->nid);
db_query("UPDATE {files} set filepath='%s' WHERE fid=%d", $image->images['_original'], $file->fid);
drupal_set_message(t('Created image post from your uploaded file %file. You can look and update at it <a href="@url">here</a>.', array('%file' => $file->filename, '@url' => url('node/'. $image->nid))));

#11

giorgio79 - March 17, 2009 - 03:36

Getting this error message as well, but I use CCK imagefield and imagecache...

#12

killes@www.drop.org - May 17, 2009 - 00:28
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:active» fixed

marked #236251: Incongruent filepaths between upload and image upload modules as duplicate.

Applied a fix to the D6-dev branch

#13

System Message - May 31, 2009 - 00:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#14

jessia - July 9, 2009 - 16:00
Status:closed» active

I see this issue has been closed for a while, but I'm encountering this error with Drupal 6.13 and 6.x-1.x-dev using Import Image.

The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
user warning: Duplicate entry '505' for key 1 query: INSERT INTO vdrupal_xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (505, 1247154827, 1247154826, 0, -2) in (path)/includes/common.inc on line 3436.

0 ms After saving new content has been invoked.
0.78 ms Executing the rule Profile has been created on rule set After saving new content
0.857 ms Evaluation of After saving new content has been finished.
Successfully imported:
Imported P1302959.JPG as P2013264 [edit].

The node is created, but no image is displayed. When I go to edit the node, the path to the image is blank.

The funny thing is, I was successfully using Import Image to upload images a week ago, and now I can't. I tried to import a few hundred images, and they all failed in this way.

Any help would be appreciated.

#15

salvis - October 23, 2009 - 22:25

FWIW, I'm seeing the same error with img_assist...

The message is from file_copy().

#16

salvis - November 22, 2009 - 19:34
 
 

Drupal is a registered trademark of Dries Buytaert.