I can't upload any file when use "Session variable storage"

Upload destination: Session variable storage
Error message
The file could not be uploaded.

anyway, what is "Session variable storage" ?

Comments

damien tournoud’s picture

Project: Drupal core » Examples for Developers
Version: 7.x-dev »
Component: field system » File Example

Session variable storage is an example implementation of a file storage in Drupal 7. It is part of the Examples module, that you probably have installed.

I find it interesting that it doesn't work :)

rfay’s picture

@droplet, can you please say exactly what you're doing and what fails?

If you are reporting a bug, it needs to consist of three things:

* What are the steps required to reproduce the bug?
* What behavior were you expecting?
* What happened instead?

Please include as much information as you can: OS, webserver name and version, PHP version, Drupal version, Drupal path, and everything else you might feel is relevant. There is no such thing as a bug report that is too detailed.

droplet’s picture

thanks for all replies. thought this is a core function before.

my test:
1. fresh installation
2. active file examples
3. change core field storage to "Session variable storage"
4. create a node and upload a file

Apache/2.2.12 (Ubuntu) , PHP 5.2.10
Drupal & modules are Dev. version (up to date)

rfay’s picture

Title: Field Session variable storage error » All streamwrapper implementations are offered as field storage

Wow, I had no idea that providing an additional streamwrapper would activate that streamwrapper for field storage! Incredible. Not sure how good that is.

I will try to take some time at some point to investigate this, but it's probably not terribly important right now.

rfay’s picture

Things to do as a result of this issue:

1. (easy) Change the name of the session variable storage so it includes the word "example" to encourage people not to use it.

2. Fix the problem described in this issue. You *should* be able to save at least a small file.

3. D7 core should not just offer *every* streamwrapper instance for file storage (I don't think)

rfay’s picture

Status: Active » Needs review
StatusFileSize
new2.68 KB

This should fix #1 and #2. Unfortunately, it will not be able to store arbitrary files - only text files will work because the underlying storage is string storage.

rfay’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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