首页 \ 问答 \ 如何在dropbox上传文件的方法中传递imageView.image(How to pass imageView.image in dropbox upload file method)

如何在dropbox上传文件的方法中传递imageView.image(How to pass imageView.image in dropbox upload file method)

我试图从uiimagepicker上传图像它在imageview中返回图像。

现在我想将这张选中的图片上传到Dropbox。 我怎样才能做到这一点

我的代码是

- (IBAction)uploadButtonPressed:(id)sender {

    [restClient uploadFile:@"Test.png" toPath:@"/" fromPath:imageview.image];

}   

这是给出了警告,因为它采取了fromPath的 NSString :如何在这里传递图像的名称?


I am trying to upload image from uiimagepicker It is returning image in imageview.

Now I want to upload this selected image to dropbox. How can I do this

my code is

- (IBAction)uploadButtonPressed:(id)sender {

    [restClient uploadFile:@"Test.png" toPath:@"/" fromPath:imageview.image];

}   

this is giving warning because It take NSString in fromPath: How to pass image here with its name?


原文:https://stackoverflow.com/questions/6110169
更新时间:2019-07-04 03:12

最满意答案

您首先需要将图像保存到文档目录,然后是所有功能:

[restClient uploadFile:@"Test.png" toPath:@"/" fromPath:@"path/of/file/indocmentdirectory"];

You will first need to save the image to the document directory, then all the function:

[restClient uploadFile:@"Test.png" toPath:@"/" fromPath:@"path/of/file/indocmentdirectory"];
2011-05-24

相关问答

更多

android dropbox api文件上传(android dropbox api file upload)

private boolean exists(String path) { try { Entry existingEntry = mApi.metadata(path, 1, null, false, null); return true; } catch (DropboxServerException e) { if(e.error == DropboxServerException._404_NOT_FOUND) ...

Dropbox - IOS- Swift 3:无法获取缩略图(Dropbox - IOS- Swift 3 : Cannot get the thumbnail image)

如果您想使用API v2 Swift SDK在Dropbox中获取文件的缩略图,则使用其中一种getThumbnail方法是正确的方法。 对于getThumbnail(path:format:size:overwrite:destination:) ,请注意这会将缩略图数据写入您指定的URL。 (即,它不提供托管缩略图数据的因特网可访问URL。) getThumbnail(path:format:size:overwrite:destination:)方法是一种下载式请求,因此您应该按照“下载到U ...

用vbscript登录Dropbox(Login to Dropbox with vbscript)

考虑下面的例子有节点可访问性扩展检查和使用.submit方法,而不是.submit ,因为最后一个导致我的403错误页面: Option Explicit Dim objIE, strMsg DropBoxLogin objIE, strMsg MsgBox strMsg Sub DropBoxLogin(objIE, strMsg) Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible ...

如何将布尔值传递给具有变量名称的方法(How to pass a boolean to a method with a variable name)

通过引入和额外的闭包,您可以创建一个可读的微型DSL: def performCleanup = { println "cleanup $it" //delete local file } def upload(fileName) { println "upload file $fileName" //upload file [then: { action -> action(fileName) }] } upload "path" upload "path" then ...

创建临时图像文件以供上传(create a temp image file for upload)

将base64_decode()而不是file_get_contents的返回值传递给AWS SDK。 file_get_contents将文件加载到字符串中,base64_decode加载base64字符串并返回一个字符串。 由于您有base64字符串而不是文件,因此您可以调用base64_decode。 Pass the return value of base64_decode() instead of file_get_contents to the AWS SDK. file_get_c ...

从iphone应用程序将文件保存到Dropbox(Save file to dropbox from iphone app)

做这种事情的最好方法可能是使用Dropbox Objective-C API The best way to do such a thing is probably to use Dropbox Objective-C API

文件上传不检查现有图像(file upload doesn't check for existing image)

您无需删除任何代码 - 只需更改调用函数的方式即可。 该功能定义为: function uploadFile ($file_field = null, $check_image = false, $random_name = false) 您可以看到$random_name变量作为参数传递给函数。 如果设置为true ,则为上载的图像设置随机文件名。 你正在调用这个函数: $file = uploadFile('file', true, true); 所以你可以看到你传递的第三个参数(即对应于$ ...

如何使文件输入上传原始图像文件,而不是在IOS上强制转换为jpeg(How to make a file input upload the original image file instead of forcing conversion to jpeg on IOS)

你不能。 关于上传的iOS移动版Safari非常有限。 您的图片将始终以低于原始图片的质量转换为JPEG图片。 “解决方案”: 显而易见的是去土生土长(这可能会击败这个问题的目的,但我认为我会抛弃它)。 更“合理”的解决方案是让用户给你一个链接到原始图片(例如Dropbox)或类似的东西。 尽管如此,并不是真正的解决方案,但就像我说的那样,目前没有任何解决这个问题的好方法。 You can't. Mobile Safari for iOS is very limited when it comes ...

相关文章

更多

最新问答

更多
  • Android宽度:100%修复(网站接管问题)(Android width:100% fix (website takeover issue))
  • C ++函数/方法设计的良好实践(Good practice in C++ function/method design)
  • 计算其他表中不存在的所有记录 - SQL查询(Count all records that does not exist to other table - SQL Query)
  • 为什么我要用JPA共享ID?(Why do I get shared Ids with JPA?)
  • asp.net - 如何显示来自html格式的数据行的字段(asp.net - how to display a field from data row that is in html format)
  • 我们如何使用ActiveRecord从连接表中删除行?(How can we delete rows from a join table by using ActiveRecord?)
  • ng-class搞乱了类的顺序(ng-class messing with the order of classes)
  • oracle 12g无效数字错误(oracle 12g invalid number error)
  • 更改ng-src值onclick(Change ng-src value onclick)
  • 如何在android中自动添加自定义依赖项以创建新项目?(How to add custom dependencies automatically in android for ever a new project is created?)
  • datetime函数在PHP中(datetime function in php)
  • 在javascript中获取会话数组的值(in javascript get the value of a session array)
  • 如何在UTF8中编译LaTeX?(How can I compile LaTeX in UTF8? [closed])
  • Rspec:“array.should == another_array”,但不用担心订单(Rspec: “array.should == another_array” but without concern for order)
  • Logcat错误:无法在android片段中加载视图(Logcat error: unable to load view in android fragments)
  • JavaFX的。(JavaFX. Adding items to the list in different threads is not working)
  • 从GDATA日历资源迁移到Google Calendar Resource api(Migrate from GDATA calendar resource to Google Calendar Resource api)
  • SSRS 2008 - 以零情景处理分割(SSRS 2008 - Dealing with division by zero scenarios)
  • 我如何以编程方式添加一个listView列标题的点击事件(How can I add a listView column header a click event programmatically)
  • Wxpython:无法检索有关列表控件项XXX的信息(Wxpython: Couldn't retrieve information about list control item XXX)
  • 使用Tortoise SVN在SVN存储库中移动目录(Move Directory across SVN repository using Tortoise SVN)
  • 天蓝色服务结构集群中的web api无状态服务是否在一段时间不活动后进入休眠状态?(Do web api stateless services in azure service fabric cluster go to sleep after a period of inactivity?)
  • 我可以设置intelliJ来突出显示PHP编码风格吗?(Can I set intelliJ to highlight php coding style?)
  • 用javafx创建一个Truetype字体文件(Creating a Truetype Font file with javafx)
  • Spring ftp配置错误(Spring ftp configuration is wrong)
  • 使用gsub去除多个字符(Using gsub to strip multiple characters)
  • 续订推送证书并保持当前的App Store App正常工作(Renew Push certificate and keep current App Store App working)
  • js:ES5和ES6之间关于'this'关键字用法的一个令人困惑的观点(js: one confusing point about 'this' keyword usage between ES5 and ES6)
  • window.onload vs $(document).ready()(window.onload vs $(document).ready())
  • 在Swift中,如何声明一个符合一个或多个协议的特定类型的变量?(In Swift, how can I declare a variable of a specific type that conforms to one or more protocols?)