Giter VIP home page Giter VIP logo

Comments (9)

FredvanRijswijk avatar FredvanRijswijk commented on August 9, 2024

I'm really need some help with this...

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Sorry, just saw this. I'm trying to figure out where its failing for you. So, does it seem like the file is uploading correctly? Are you getting a url back from parse.com? And when you access that url through a browser its giving you a access denied? Is this correct?

from parse.com-php-library.

FredvanRijswijk avatar FredvanRijswijk commented on August 9, 2024

Yes, it's giving me a URL that's says access denied!

I saw that you only can use binary data... Just can't figure it out...

How to use it in a form and save it with an object at the same time or apart, it's keeps me busy for a couple of days now...

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Well, ok the above code is a little messed up. You should have something more like this for what you are trying to do:

//first you have to get a return from parse before associating with any objects
$filename = 'http://url.com/images/musea/'.$_FILES['cImage']['name'];
$file = new parseFile('image/jpeg', file_get_contents($filename));
$fileReturn = $file->save('testimage.jpg');

//then you create your parseObject or 
//update an existing object by using the update($objectId) method instead of save()
$parse = new parseObject('Locations');
$parse->image = $parse->dataType('file', array( $fileReturn['name'] );
$parse->save();

Can you please try the above and see what results you are getting. If you are still getting access denied, can you send me the exact output you get from $fileReturn?

from parse.com-php-library.

FredvanRijswijk avatar FredvanRijswijk commented on August 9, 2024

$fileReturn is ok now, getting an error on Fatal error: Cannot use object of type stdClass as array on $parse->image = $parse->dataType('file', array( $fileReturn['name'] ));

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Oh, yes my mistake... that line should be:

$parse->image = $parse->dataType('file', array( $fileReturn->name ));

I was accessing $fileReturn as an array, when I should have been accessing it as an object

from parse.com-php-library.

FredvanRijswijk avatar FredvanRijswijk commented on August 9, 2024

WOw stupid me, almost had the same code before... But getting errors is so frustrating and thinking I was wrong, it's WORKING! Thnx!!!

from parse.com-php-library.

andrewscofield avatar andrewscofield commented on August 9, 2024

Great to hear!
On Nov 22, 2012 1:41 AM, "Fred van Rijswijk" [email protected]
wrote:

WOw stupid me, almost had the same code before... But getting errors is so
frustrating and thinking I was wrong, it's WORKING! Thnx!!!


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-10628565.

from parse.com-php-library.

luisbatista avatar luisbatista commented on August 9, 2024

Great, is what I need to upload my images and connect with objects.

from parse.com-php-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.