Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing files not working. #44

Open
GoogleCodeExporter opened this issue May 22, 2015 · 0 comments
Open

Writing files not working. #44

GoogleCodeExporter opened this issue May 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Retrieve attachments (as per example)
2. Write attachments to directory
3. -

What is the expected output? What do you see instead?
Attached file to be written to directory.
Files are not written.
No errors are generated.

What version of the product are you using?
Downloaded today (02-JUL-2014)

On what operating system?
Ubuntu 12.04LTS

Using this code to write files:
foreach($attachments as $attachment) {
  // get the attachment name
  $filename = $attachment->filename;
  $file_list .= $filename."<br>";
  // write the file to the directory you want to save it in
  if ($fp = fopen($save_dir.$filename, 'w')) {
    while($bytes = $attachment->read()) {
      fwrite($fp, $bytes);
    }
    fclose($fp);
  }
}

Original issue reported on code.google.com by jax.contine on 2 Jul 2014 at 8:50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant