upload

zend framework losing session

元气小坏坏 提交于 2019-12-21 05:19:21
问题 I am trying to implement a Flash uploader in my Zend framework application but I am having problems with the session. The Flash does not send any cookie headers and this is why the session is lost. I am trying to send the sessionId as a post param and in my bootstrap file I added a session_id($_POST['session_id]) but this doenst seem to work. I am using a MySQL table as session storage I tryed to debug the error and as far as I see, the session_id is set, and the storage returns the corect

JS ProgressEvent is only fired when finished

纵然是瞬间 提交于 2019-12-21 05:05:24
问题 I am having some problems getting my upload progress bar to work properly. According to the XMLHttpRequest Level 2 specs, I attached event listeners for loadstart and progress like this: var xhr = $.ajaxSettings.xhr(); xhr.upload.addEventListener('loadstart', function(e) {progressCallback(0);}); xhr.upload.addEventListener('progress', function (e) { progressCallback(e.loaded / e.total); }); $.ajax({ url: url, type: 'POST', processData: false, contentType: false, data: formData, xhr: function

How to upload an artifact to Artifactory / consume it in a build system (Gradle Maven Ant) where the artifact does not have an extension

浪尽此生 提交于 2019-12-21 04:51:29
问题 I have the following files which I would like to upload to Artifactory as a 9.8.0 versioned artifact. NOTE : The first two files DO NOT have an extension (they are executable files i.e. if you open them/cat on it, you'll see junk characters). Folder/files of a given version 9.8.0 in CVS is like: com.company.project/gigaproject/v9.8.0/linux/gigainstall com.company.project/gigaproject/v9.8.0/solaris/gigainstall com.company.project/gigaproject/v9.8.0/win32/gigainstall.exe com.company.project

How to upload an artifact to Artifactory / consume it in a build system (Gradle Maven Ant) where the artifact does not have an extension

纵然是瞬间 提交于 2019-12-21 04:51:04
问题 I have the following files which I would like to upload to Artifactory as a 9.8.0 versioned artifact. NOTE : The first two files DO NOT have an extension (they are executable files i.e. if you open them/cat on it, you'll see junk characters). Folder/files of a given version 9.8.0 in CVS is like: com.company.project/gigaproject/v9.8.0/linux/gigainstall com.company.project/gigaproject/v9.8.0/solaris/gigainstall com.company.project/gigaproject/v9.8.0/win32/gigainstall.exe com.company.project

Codeigniter and RestServer. How to upload images?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 04:37:08
问题 I am coding an API using Phils RestServer (see link) in Codeigniter. I need a way to upload images via the API. How can I do that? Is it just as simple as making a POST request with the correct headers (what headers to use)? https://github.com/philsturgeon/codeigniter-restserver Thankful for all input! 回答1: Ok, There is another solution here: FIle upload from a rest client to a rest server But neither of these solutions worked for me. However, this is what worked; actually worked. First, I

How do I make Flex file upload work on firefox and safari?

瘦欲@ 提交于 2019-12-21 04:22:13
问题 I have a flex app that uploads files to a server. The server requires authentication to be able to upload. In IE the upload works fine. However in FF and Safari, it does not upload. I have seen people all over with this same problem but no answers. Don't fail me now stackoverflowers. 回答1: I found this question while trying to find the answer myself. The solution was rather simple. Based on the flash player bug that others have linked, and the comments on that page, I decided to append session

Golang file upload: close connection if file is too large

一曲冷凌霜 提交于 2019-12-21 04:04:57
问题 I want to allow uploading files. Go is being used server-side to handle requests. I would like to send a response "File too large" whenever the file they're trying to upload is too large. I would like to do so, before the entire file is uploaded (bandwidth). I am using the following snippet, but it's only sending a response after the client is done uploading. It saves a 5 kB file. const MaxFileSize = 5 * 1024 // This feels like a bad hack... if r.ContentLength > MaxFileSize { if flusher, ok :

Is there any way to get upload progress correctly with HttpUrlConncetion

守給你的承諾、 提交于 2019-12-21 03:48:31
问题 Android Developers Blog recommend to use HttpURLConnection other than apache's HttpClient (http://android-developers.blogspot.com/2011/09/androids-http-clients.html). I take the advice and get problem in reporting file upload progress. my code to grab progress is like this: try { out = conncetion.getOutputStream(); in = new BufferedInputStream(fin); byte[] buffer = new byte[MAX_BUFFER_SIZE]; int r; while ((r = in.read(buffer)) != -1) { out.write(buffer, 0, r); bytes += r; if (null !=

Saving Original File Name in Django with FileField

蓝咒 提交于 2019-12-21 02:31:07
问题 def generate_uuid_file_name(self, filename): self.original_filename = filename extension = filename.rsplit('.', 1)[1] newfilename = uuid.uuid4().__str__() + '.' + extension return self.directory() + newfilename class FileUpload(models.Model): original_filename = models.CharField(max_length=128) fileobj = models.FileField(upload_to=generate_uuid_file_name) On upload, {"errors": {"original_filename": ["This field is required."]}, "success": false} Adding blank=True, null=True to the FileUpload

Saving Original File Name in Django with FileField

Deadly 提交于 2019-12-21 02:31:07
问题 def generate_uuid_file_name(self, filename): self.original_filename = filename extension = filename.rsplit('.', 1)[1] newfilename = uuid.uuid4().__str__() + '.' + extension return self.directory() + newfilename class FileUpload(models.Model): original_filename = models.CharField(max_length=128) fileobj = models.FileField(upload_to=generate_uuid_file_name) On upload, {"errors": {"original_filename": ["This field is required."]}, "success": false} Adding blank=True, null=True to the FileUpload