4

Every time I try to upload an image to the Media Library using Firefox, I get a pop up error that says "An error occured while uploading a file". Upon examination of the sitecore logs, I see the following in the stacktrace:

288 11:29:27 ERROR Application error.
Exception: System.ArgumentException
Message: Illegal characters in path.
Source: mscorlib
at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access,        AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean    needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access,     String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[]   pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.File.GetLastWriteTimeUtc(String path)
at Sitecore.Resources.Media.MediaData.get_MediaId()
at Sitecore.Resources.Media.MediaCache.CanCache(Media media, MediaOptions options)
at Sitecore.Resources.Media.MediaCache.GetStream(Media media, MediaOptions options)
at Sitecore.Resources.Media.Media.GetStream(MediaOptions options)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context,   MediaRequest request, Media media)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context)
at Sitecore.Resources.Media.MediaRequestHandler.ProcessRequest(HttpContext context)
at     System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute    ()
at     System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute    ()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Heartbeat 11:30:04 WARN Memory usage exceeded the MemoryMonitor threshold.
Heartbeat 11:30:04 WARN Memory usage: 1,680,764,928
Heartbeat 11:30:04 WARN Number of suppressed logs due to the minimum time between log entries: 10

I can tell there is some kind of illegal character exception, but I don't know where to look from here. What could be the cause of this issue and how might I fix it? Is there somewhere to configure the file path in sitecore?

I am using Sitecore 6.5

user1431072
  • 1,272
  • 2
  • 13
  • 32
  • 1
    What's the file name / type? What's the media library path? What other media items are in that location? – Martin Davies Jan 20 '14 at 17:53
  • 1
    Try changing the name of the image file to ImageTry.ext and upload it to the root of Media Library and see if you get the same error message. – Shriroop Jan 20 '14 at 17:55
  • 2
    can you modify this setting and make it true –  Jan 20 '14 at 18:00
  • Is this a Firefox only issue, or the same in other browsers too? – jammykam Jan 20 '14 at 18:04
  • Which version and revision of Sitecore? – jammykam Jan 20 '14 at 19:12
  • @Shriroop I just tried changing the nae of the file to ImageTry.jpg and uploaded it to the root of the media library. I received the same error. – user1431072 Jan 20 '14 at 19:17
  • @jammykam This is a Firefox only issue. To be more specific, I'm using Firefox 26.0. I can upload the same image in sitecore on Chrome or IE10 just fine. – user1431072 Jan 20 '14 at 19:18
  • @user1431072 No, I meant which version and revision of **Sitecore** – jammykam Jan 20 '14 at 19:31
  • 2
    Did you try my suggestion ? –  Jan 20 '14 at 19:31
  • @jammykam I'm using Sitecore.NET 6.5.0 (rev. 120706) – user1431072 Jan 20 '14 at 19:35
  • 1
    I've found Firefox support has been buggy, more so since you are using an older version of Sitcore with a newer version of Firefox, the combination of which is untested. Try @sitecoreclimber suggestion. It should fix your issue, if not then reply back and we will try helping. – jammykam Jan 20 '14 at 19:38
  • @sitecoreclimber It worked! Setting Upload.Classic to true resolved my problem. Thank you sitecoreclimber and all! – user1431072 Jan 20 '14 at 19:55
  • I will write my suggestion like an answer. –  Jan 20 '14 at 20:02

1 Answers1

8

I had this problem also on Firefox and Safari. Please change setting Upload.Classic to true. It will be :

 <setting name="Upload.Classic" value="true" />
  • Thank you! Looks like the Upload.Classic set to true uses the standard fileupload control rather than flash. This fixed it for me! – user1431072 Jan 20 '14 at 20:07
  • Yes, I know is using standard fileupload, but I don't know why is different on FF and Safari –  Jan 20 '14 at 20:08
  • With "Upload.Classic" set to true, is the advanced 'Upload Files' still an option? – Ben Sewards Apr 21 '14 at 15:31
  • @BenSewards Yes it is still an option, however you get a different dialog from the flashy one. – Anicho Sep 04 '14 at 15:44