I’m working on a PHP web application that integrates with Google Drive through their API. When my app uploads files to Google Drive, the upload process completes without any errors and I can access the uploaded files directly using their URLs. However, these files don’t show up when I browse through the Google Drive interface or when I try to list folder contents programmatically.
Has anyone encountered this before? I’m wondering if this could be related to folder permissions, API scopes, or maybe the way I’m setting file metadata during upload. Any suggestions on what might be causing this visibility issue would be really helpful.
Had the same issue about six months ago. Turned out to be a file visibility problem during upload. Google Drive defaults to restricted visibility sometimes - files are accessible via direct URL but won’t show up in folder views. You need to explicitly set the visibility property in your file metadata or adjust the sharing settings so the folder owner can see it. Also check if you’re using the right MIME type - wrong MIME types let files upload but mess up the folder indexing. Add explicit visibility parameters to your upload request and that should fix it.
This sounds like a scoping issue. I had the same thing happen when I used the basic Drive API scope instead of the full one. Files uploaded fine but stayed invisible in the normal Drive interface. Check if you’re using ‘https://www.googleapis.com/auth/drive.file’ vs ‘https://www.googleapis.com/auth/drive’ - the first one only lets you access files your app created, which causes weird visibility issues. Also double-check your service account or OAuth credentials have the right permissions. I wasted hours debugging this exact problem before figuring out it was just the scope.
for sure! if u dont specify the ‘parents’ field when uploading, the files might not show up in the right folder. double-check ur code to make sure the parent folder ID is set correctly in the metadata. hope that helps!