Klasörler, yalnızca meta veri içeren dosyalardır ve Google Drive'daki dosyaları düzenlemek için kullanılabilir. Bunlar aşağıdaki özelliklere sahiptir:
- Klasör, MIME türünde
application/vnd.google-apps.folder
olan ve uzantısı olmayan bir dosyadır. root
takma adı, bir dosya kimliğinin sağlandığı her yerde kök klasöre referansta bulunmak için kullanılabilir.
Drive klasör sınırları hakkında daha fazla bilgi için Dosya ve klasör sınırları başlıklı makaleyi inceleyin.
Bu kılavuzda, klasörle ilgili bazı temel görevlerin nasıl gerçekleştirileceği açıklanmaktadır.
Klasör oluşturun
Klasör oluşturmak için application/vnd.google-apps.folder
MIME türü ve bir başlık içeren files.create
yöntemini kullanın. Aşağıdaki kod örneğinde, istemci kitaplığını kullanarak nasıl klasör oluşturulacağı gösterilmektedir:
Java
Python
Node.js
PHP
.NET
Belirli bir klasörde dosya oluşturma
Belirli bir klasörde dosya oluşturmak için files.create
yöntemini kullanın ve klasör kimliğini dosyanın parents
özelliğinde belirtin. parents
özelliği, dosyayı içeren üst klasör kimliklerini içerir. Aşağıdaki kod örneğinde, bir istemci kitaplığı kullanılarak belirli bir klasörde nasıl dosya oluşturulacağı gösterilmektedir:
Java
Python
Node.js
PHP
.NET
parents
özelliği, üst düzey bir klasörde veya başka bir klasörde dosya oluştururken kullanılabilir.
Klasörler arasında dosya taşıma
Dosyaları taşımak için parents
özelliğinin kimliğini güncellemeniz gerekir.
Mevcut bir dosyaya üst öğe eklemek veya kaldırmak için addParents
ve removeParents
sorgu parametreleriyle files.update
yöntemini kullanın. Aşağıdaki kod örneğinde, istemci kitaplığı kullanılarak klasörler arasında nasıl dosya taşınacağı gösterilmektedir:
Java
Python
Node.js
PHP
.NET
Dosya ve klasör sınırları
Drive dosya ve klasörlerinin bazı depolama alanı sınırları vardır.
Kullanıcı öğesi sınırı
Her kullanıcı, o hesap tarafından oluşturulmuş en fazla 500 milyon öğeye sahip olabilir. Bu sınıra ulaşıldığında kullanıcı artık Drive'da öğe oluşturamaz veya Drive'da öğe yükleyemez. Mevcut öğeleri görüntülemeye ve düzenlemeye devam edebilirler. Tekrar dosya oluşturmak için kullanıcıların öğeleri kalıcı olarak silmesi veya farklı bir hesap kullanması gerekir. Daha fazla bilgi edinmek için Dosya ve klasörleri çöp kutusuna taşıma veya silme başlıklı makaleye göz atın.
Bu sınıra dahil edilen nesneler şunlardır:
- Kullanıcı tarafından Drive'da oluşturulan veya yüklenen öğeler
- Kullanıcı tarafından oluşturulan ancak artık başka birine ait öğeler
- Çöp kutusundaki öğeler
- Kısayollar
- Üçüncü taraf kısayolları
Bu sınıra dahil edilmeyen nesneler şunlardır:
- Kalıcı olarak silinen öğeler
- Kullanıcıyla paylaşılan ancak başkasına ait öğeler
- Kullanıcıya ait olan ancak başkası tarafından oluşturulan öğeler
500 milyondan fazla öğe ekleme girişimleri, activeItemCreationLimitExceeded
HTTP durum kodu yanıtı döndürür.
Bir hizmet hesabının sahip olabileceği öğe sayısıyla ilgili bir sınır olmasa da 500 milyon öğe sınırının bir hizmet hesabının oluşturabileceği öğe sayısı için geçerli olduğunu unutmayın.
Klasör-öğe sınırı
Kullanıcının Drive'ım bölümündeki her klasör 500.000 öğelik sınıra sahiptir. Bu sınır, Drive'ım klasörünün kök klasörü için geçerli değildir. Bu sınırda hesaba katılan öğeler şunlardır:
- Klasörler
- Dosyalar. Dosya sahipliğinden bağımsız olarak tüm dosya türleri.
- Kısayollar. işaret ettiği öğe söz konusu klasörde olmasa bile bir klasör içinde tek bir öğe olarak sayılır. Daha fazla bilgi edinmek için Drive dosyası için kısayol oluşturma başlıklı makaleyi inceleyin.
- Üçüncü taraf kısayolları. işaret ettiği öğe söz konusu klasörde olmasa bile bir klasör içinde tek bir öğe olarak sayılır. Daha fazla bilgi için Uygulamanız tarafından depolanan içerik için kısayol dosyası oluşturma bölümüne bakın.
Klasör sınırları hakkında daha fazla bilgi edinmek için Google Drive'da klasör sınırları başlıklı makaleyi inceleyin.
Klasör derinliği sınırı
Kullanıcının Drive'ım bölümünde en fazla 100 düzeyde iç içe yerleştirilmiş klasör bulunabilir. Bu, alt klasörün 99 düzeyden daha derin olan klasörlerde depolanamayacağı anlamına gelir. Bu sınırlama yalnızca alt klasörler için geçerlidir. application/vnd.google-apps.folder
dışında bir MIME türüne sahip alt dosya bu sınırlamadan muaftır.
Örneğin, aşağıdaki şemada yeni bir klasör 99 numaralı klasör içine yerleştirilebilir, ancak 100 numaralı klasörün içine yerleştirilemez. Ancak 100 numaralı klasör, dosyaları diğer tüm Drive klasörleri gibi depolayabilir:
100'den fazla klasör düzeyi ekleme girişimleri, myDriveHierarchyDepthLimitExceeded
HTTP durum kodu yanıtı döndürür.