PythonAnywhere Forums

Unable to edit uploaded files

Hi, I've uploaded a csv and jpg files and they are greyed out in the file tab (can't edit and not linked). I'm on a Mac and have tried both Chrome and Safari. When I inspect the elements in the file tab there is leading and trailing whitespace in the filenames. Have tried mv but no luck, not even sure the whitespace is the problem. Any help would be much appreciated. Thank you

that's because you can't edit a jpg- it doesn't make sense. you would be editing binary data.

Sure you can, but yeh you probably wouldn't want to. The point is the csv cannot be edited nor linked to via static map nor can the jpg be linked to via the static folder and yes the static url and directory path seem to be working as there is another csv that can be served via ~ .pythonanywhere.com/static/somefile.csv

jpgs should be served as static files if you have set it up from your webapp static file mappings.

but if you are talking about navigating to it from the file tab on PythonAnywhere, then they are not editable.

Just to clarify -- in the "Files" tab,

  • For jpgs -- PythonAnywhere doesn't have a built-in image editor, of course, so you don't get a link to them in the "Files" tab. However you can view them by clicking on the "download" icon to the right of the filename.
  • For CSVs -- our editor doesn't work well with large files (I think the limit is 500kB) so if your CSV is really big, it might not show up as editable...?

For static files: could you give us an example of a static file URL that doesn't work? And can I take a look at your files? We can see them from our admin interface, but we always ask permission first.

Hi ok great, yes the csv is bigger than 500kb so that explains that, this URL is not working- http://matthewgaber.pythonanywhere.com/static/ml.jpg ml.jpg was uploaded via 'Upload a file'

This URL kind of works- http://matthewgaber.pythonanywhere.com/static/mytable.png at the moment it is serving a cached version of the image but when you click the download button in the file console you get the correct version. I've tried on browsers that had never been to the site so not browser cache issue. mytable.png was not uploaded but rather written via

plt.savefig('/home/MatthewGaber/static/mytable.png')

I'll drop you an email about this.

My mistake, I had URL: /static/ and Directory: /home/username when it should have been URL:/static and Directory:/home/username/static

Cool. Glad you worked it out.